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

Reconsider all commands to use a ctx.reply wrapper with pings disabled #42

Closed
Arcensoth opened this issue Aug 23, 2021 · 0 comments · Fixed by #46
Closed

Reconsider all commands to use a ctx.reply wrapper with pings disabled #42

Arcensoth opened this issue Aug 23, 2021 · 0 comments · Fixed by #46
Assignees
Labels
enhancement New feature or request

Comments

@Arcensoth
Copy link
Member

It is possible to have the bot send a message containing mentions, but without actually pinging the users or roles mentioned. It is also possible to disable at-everyone/at-here and reply-to-user pings.

This means there's no need to edit the mentions in after-the-fact, or use embeds specifically to avoid pings.

However, this requires an allowed_mentions parameter to be passed in with every Context.send() or Context.reply() call:

await ctx.send("Some message", allowed_mentions=AllowedMentions.none())

This behaviour can be configured globally for the bot by default, but it cannot be configured at the extension level.

A more succinct solution might be to wrap all send/reply calls in a method that supplies the allowed_mentions by default:

async def reply(self, ctx: GuildContext, content: str):
    """Wraps `Context.reply()` with some extension-default boilerplate."""
    await ctx.reply(
        content,
        allowed_mentions=AllowedMentions.none(),
    )

Such a method can be defined and adjusted per-extension.

@Arcensoth Arcensoth added the enhancement New feature or request label Aug 23, 2021
@Arcensoth Arcensoth self-assigned this Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant