bot icon indicating copy to clipboard operation
bot copied to clipboard

Ping different roles depending on the roles the creator has

Open eartharoid opened this issue 2 years ago • 1 comments

Discussed at dsctickets#2994

Originally posted by King Tiger at 20.04.2021 add ping, like a member have "x" role, ping "x" instead of here suppose if a Member have Spanish role, i want it to Ping Spanish instead of here basically putting a condition to fetch role then ping

eartharoid avatar Feb 15 '23 01:02 eartharoid

This new settings format is not backwards compatible so it would either need to also support the existing format ['123'. '456'], or update or reset the property when the bot is updated.

  • If pingRoles.roles is an array, pingRoles.mode is ignored and is always all - equivalent to the current behaviour. Or just use the {if: then} format with the everyone role?
  • If pingRoles.roles is not an array (so is an object), dynamic:ly select roles:
    • If pingRoles.mode is all, ping every value where the member has key
    • If pingRoles.mode is highest, find the highest key that the member has and ping its value

Examples:

// always
// -> @123, @456
{
  mode: 'all',
  roles: ['123', '456']
}
// if the member has both 123 and 234,
// -> @456, @567
{
  mode: 'all',
  roles: {
    '123': '456',
    '234': '567',
  }
}
// if the member has both 123 and 234, assuming 123 is higher in the role hierarchy,
// -> @456
{
  mode: 'highest',
  roles: {
    '123': '456',
    '234': '567',
  }
}

eartharoid avatar Mar 23 '23 15:03 eartharoid