1

我希望能够通过我的不和谐进行交谈,但我不确定如何编写这样的代码;这是我尝试过的。

from discord.ext.commands import Bot

Mike = Bot(command_prefix=",")

@Mike.command()
    async def Msay(*args, message):
        Mike.delete_message(message)
        return await Mike.say(args)

Mike.run(secrets.BOT_TOKEN)

我希望能够输入我的不和谐聊天

我:,Msay hello world

我的消息已删除

Mike-Bot:你好世界

4

1 回答 1

2
import asyncio
import discord
from discord.ext.commands import Bot

Mike = Bot(',')

@Mike.command(pass_context = True)
async def Msay(ctx, *args):
    mesg = ' '.join(args)
    await Mike.delete_message(ctx.message)
    return await Mike.say(mesg)

Mike.run(Token)
于 2017-04-19T02:02:47.720 回答