Added check to see if the given role_name string is in the format of a role mention, and if it is, get the appropriate role from the server. This allows the ability to enter a role mention to create a role button, along with the option of just the role name as well.
Issues
Closes #293
Type of change
Select one or more of the following:
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Other (describe below)
How Has This Been Tested?
[ ] Create role button with @ role mention
[ ] Run /createrolebutton in the testing server
[ ] Enter an @ role mention in the role_name parameter
[ ] Enter the remaining information and create the button
[ ] Click the button and verify the correct role is given/removed from you
[ ] Create role button with role name
[ ] Run /createrolebutton in the testing server
[ ] Enter the string name of a role in the server (or not in the server, in which case it will create it)
[ ] Enter the remaining information and create the button
[ ] Click the button and verify the correct role is given/removed from you
[ ] Create role button with <@&> in the string (I doubt anyone would do this but I wanted to cover all bases)
[ ] Run /createrolebutton in the testing server
[ ] Enter the string name of a role with <@& leading and > tailing the given string
[ ] Enter the remaining information and create the button
[ ] Click the button and verify the role is given/removed from you
Currently, the <@& and > are still stripped from the string even if its not a valid role, this can be updated later if needed, but I highly doubt anyone wants to create a role of that name lol
Checklist:
[x] All local commits have been pushed to remote
[x] All changes on the base branch have been merged into this branch, either by rebase or merge
[x] My code is PEP-8 compliant (excluding maximum line length, keep that to 100ish characters)
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
Description
Added check to see if the given role_name string is in the format of a role mention, and if it is, get the appropriate role from the server. This allows the ability to enter a role mention to create a role button, along with the option of just the role name as well.
Issues
Closes #293
Type of change
Select one or more of the following:
How Has This Been Tested?
/createrolebutton
in the testing server/createrolebutton
in the testing server/createrolebutton
in the testing server<@&
leading and>
tailing the given stringCurrently, the
<@&
and>
are still stripped from the string even if its not a valid role, this can be updated later if needed, but I highly doubt anyone wants to create a role of that name lolChecklist: