Skip to content

Add Better Support For Whitelisting DM Commands#953

Merged
ChrisLovering merged 2 commits into
mainfrom
dm-check
Jan 1, 2022
Merged

Add Better Support For Whitelisting DM Commands#953
ChrisLovering merged 2 commits into
mainfrom
dm-check

Conversation

@HassanAbouelela
Copy link
Copy Markdown
Contributor

Relevant Issues

Closes #952

Description

Disabled commands in DMs by default. Note that this only disables the invocation of a command in DMs, not handling of messages. This means commands which use DMs for other purposes, such as battleship will still work. (Tested with a game of battleship against @Akarys42. Issue will be updated with the victor)

Adds a toggle to the whitelist override utility, to allow explicit enabling of a command in DMs.

Did you:

Adds a toggle to the whitelist override, to allow explicit enabling of
a command in DMs, and sets the default to False.

Removes redundant `guild_only` decorators.

Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
@HassanAbouelela HassanAbouelela added area: backend Related to internal functionality and utilities type: bug Something isn't working labels Nov 20, 2021
@HassanAbouelela
Copy link
Copy Markdown
Contributor Author

The French take this one
A poor Egyptian fleet decimated by French intelligence agencies

Copy link
Copy Markdown
Contributor

@Akarys42 Akarys42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GG

@Xithrius Xithrius added the status: needs review Author is waiting for someone to review and approve label Dec 15, 2021

await self._play_game(ctx, user, board_size, str(emoji1), str(emoji2))

@guild_only()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can this be removed? The code that now handles DM-only checks is in the whitelist decorators, but that isn't applied here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whitelist decorator is applied globally here:

bot.add_check(whitelist_check(channels=WHITELISTED_CHANNELS, roles=STAFF_ROLES))

Copy link
Copy Markdown
Contributor

@Bluenix2 Bluenix2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just gonna start handing out high fives to everyone. This is great thank you!
Yay, highfive dude! This is great, hello Discord who doesn't render images.

@ChrisLovering ChrisLovering merged commit 0c7443d into main Jan 1, 2022
@ChrisLovering ChrisLovering deleted the dm-check branch January 1, 2022 23:46
@HassanAbouelela HassanAbouelela linked an issue Jan 7, 2022 that may be closed by this pull request
2 tasks
@HassanAbouelela HassanAbouelela mentioned this pull request Jan 7, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: backend Related to internal functionality and utilities status: needs review Author is waiting for someone to review and approve type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'NoneType' object has no attribute 'get_role' Block commands from working in DMs

5 participants