Role add/remove, welcome message functionality, configuration file template #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This proposed PR would resolve Issue #1 by adding bot functionality for commands !roles & !role. !roles displays a list of bot-owner added roles that the user is permitted to add to themselves, for example to see an archived channel that only the role is permitted to view, and so forth. !role role-name actually adds or removes the requested role to the user, if it exists in said bot-owner controlled list of roles from the configuration file, and first checks if the user already has the role, and if they do, removes it, and adds the role to the user other-wise.
It also resolves issue #2 by importing a welcome message from the configuration file, and if this string exists, sets the required intents to DM a new user when they first join the server, then sends them said welcome message string. If this string is not set in the configuration, then this functionality is not activated and the intents are not required to be set.
Lastly, a change was made to
on_ready()
, if there is no setBOT_CHANNEL
value, there is no reason to start the loop forupdate_channel()
as it requires theBOT_CHANNEL
variable to be set to properly run that functionality.Also, documentation was added to the
!help
command for the two new commands!roles
and!role
however it may be bad that this is in the help message even if arole list
is not configured in thepwnbotsecrets.py
configuration file, as that would need to be set by the bot owner for a user to even use!role
or!roles
. This could be misleading for a user, if the configuration has not been set by the owner.