discord.py icon indicating copy to clipboard operation
discord.py copied to clipboard

[commands]bot.process_with_str

Open sevenc-nanashi opened this issue 4 years ago • 2 comments

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 avatar Jun 15 '21 09:06 sevenc-nanashi

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.

lgaan avatar Jun 15 '21 14:06 lgaan

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

Rapptz avatar Jun 15 '21 14:06 Rapptz