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

[commands]bot.process_with_str #7067

Open
sevenc-nanashi opened this issue Jun 15, 2021 · 2 comments
Open

[commands]bot.process_with_str #7067

sevenc-nanashi opened this issue Jun 15, 2021 · 2 comments
Labels
feature request This is a feature request.

Comments

@sevenc-nanashi
Copy link
Contributor

sevenc-nanashi commented Jun 15, 2021

Summary

Add method to invoke command with context and str

What is the feature request for?

discord.ext.commands

The Problem

To run command with str(Ex: Support running multi commands by semicolons, Like "/lockdown;/purge"), it needs to edit message attribute.
But with this, it will be easier to process with str.

The Ideal Solution

for command in message.content.split(";"):
    await bot.process_with_str(message, command)

The Current Solution

before_content = message.content
for command in message.content.split(";"):
    message.content = command
    await bot.process_command(message)
message.content = before_content

Additional Context

method name is temporary.

@sevenc-nanashi sevenc-nanashi added the feature request This is a feature request. label Jun 15, 2021
@lgaan
Copy link
Contributor

lgaan commented Jun 15, 2021

I feel like this is quite a niche feature to have, and the current solution seems like a fine implementation if you want something like this.

@Rapptz
Copy link
Owner

Rapptz commented Jun 15, 2021

Something like this was planned. Might be worth revisiting it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request This is a feature request.
Projects
None yet
Development

No branches or pull requests

3 participants