Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom help command implementation #187

Merged
merged 30 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9797cd9
Added a custom handler for the help command
Aug 30, 2021
6a2d428
Added docstrings and commenting
Aug 30, 2021
9375dbc
Moved MusicCog help strings into user_strings.toml
Aug 31, 2021
277db73
Added support for user_string defined help strings as well as still s…
Aug 31, 2021
ab603c0
Added missing help string for musicadmin command group
Aug 31, 2021
23b03eb
Replace hyphens with underscores for the help string dict key
Aug 31, 2021
26c2e73
Fixed angled brackets not being escaped in README
Aug 31, 2021
0343d0b
Moved PingableRolesCog help strings into user_strings.toml
Aug 31, 2021
47eb634
Added hints for pingme command groups
Aug 31, 2021
45ba992
Changed VoicemasterCog terminology to use parent/child terminology ov…
Aug 31, 2021
efdc1d1
Fixed missing newlines for list options in Voicemaster README section
Aug 31, 2021
4fe7baf
Moved VoicemasterCog help strings into user_strings.toml
Aug 31, 2021
b702790
Renamed clear_messages command
Aug 31, 2021
781c2b4
Added missing README documentation for the version command
Aug 31, 2021
2a02662
Fixed incorrect command name in VoicemasterCog
Aug 31, 2021
152595b
Fixed an issue where checks for commands were not properly restored a…
Aug 31, 2021
a168d5a
Added support for hiding hidden commands from non-administrators
Aug 31, 2021
4f39da3
Made dev-only commands hidden
Aug 31, 2021
7a666c7
Moved help strings for AdminCog.py to user_strings.toml
Aug 31, 2021
d06bfc4
Fixed missing newlines for the log channel section in the README
Aug 31, 2021
20a74c7
Moved help strings for LogChannelCog into user_strings.toml
Aug 31, 2021
824b423
Moved help strings for TwitterCog into user_strings.toml
Aug 31, 2021
96f9af4
Fixed missing newlines for Default Roles section in README
Aug 31, 2021
5b3c680
Moved help strings for DefaultRoleCog to user_strings.toml
Aug 31, 2021
825049c
Moved help strings for EventCategoriesCog to user_strings.toml
Aug 31, 2021
f3d06c7
Moved help strings for RoleReactCog to user_strings.toml
Aug 31, 2021
620de8d
Moved help strings for VotingCog to user_strings.toml
Aug 31, 2021
501ee86
Fixed missing await in send_cog_help
Aug 31, 2021
8f58133
Moved help strings for TwitchCog to user_strings.toml
Aug 31, 2021
1719919
Fixed outdated README for Twitch Cog section
Aug 31, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moved help strings for DefaultRoleCog to user_strings.toml
  • Loading branch information
Fluxticks committed Aug 31, 2021
commit 5b3c6807e6a99480e5695a9a260617c24dc6984e
18 changes: 3 additions & 15 deletions src/esportsbot/cogs/DefaultRoleCog.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ async def on_member_join(self, member):
guildID=member.guild.id
)

@commands.command(
name="setdefaultroles",
usage="<@role> <@role> <@role> ...",
help="Sets the roles that the server gives to members when they join the server"
)
@commands.command(name="setdefaultroles")
@commands.has_permissions(administrator=True)
async def setdefaultroles(self, ctx, *, args: str):
role_list = args.split(" ")
Expand Down Expand Up @@ -86,11 +82,7 @@ async def setdefaultroles(self, ctx, *, args: str):
else:
await ctx.channel.send(self.STRINGS['default_roles_set_error'])

@commands.command(
name="getdefaultroles",
usage="",
help="Gets the roles that the server gives to members when they join the server"
)
@commands.command(name="getdefaultroles")
@commands.has_permissions(administrator=True)
async def getdefaultroles(self, ctx):
# Get all the default role for the server from database
Expand All @@ -106,11 +98,7 @@ async def getdefaultroles(self, ctx):
else:
await ctx.channel.send(self.STRINGS['default_role_missing'])

@commands.command(
name="removedefaultroles",
usage="",
help="Removes the roles that the server gives to members when they join the server"
)
@commands.command(name="removedefaultroles")
@commands.has_permissions(administrator=True)
async def removedefaultroles(self, ctx):
# Get all the default role for the server from database
Expand Down
14 changes: 14 additions & 0 deletions src/esportsbot/user_strings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,20 @@ readme_url = "https://github.com/FragSoc/esports-bot#twitter-remove-twitter-hand
help_string = "Lists all the Twitter accounts currently tracked."
readme_url = "https://github.com/FragSoc/esports-bot#twitter-list"

[help.setdefaultroles]
help_string = "Sets the list of roles to be given to users when they join the server."
usage = "<one or many role mentions>"
readme_url = "https://github.com/FragSoc/esports-bot#setdefaultroles-role_mention--role_id"

[help.getdefaultroles]
help_string = "Get the list of current default roles."
readme_url = "https://github.com/FragSoc/esports-bot#getdefaultroles"

[help.removedefaultroles]
help_string = "Removes all default roles."
description = "This will stop applying the current list of default roles to new members. Does not affect existing members."
readme_url = "https://github.com/FragSoc/esports-bot#removedefaultroles"

[logging]
channel_set = "Logging channel has been set to <#{channel_id!s}>"
channel_set_already = "Logging channel already set to this channel"
Expand Down