0

したがって、私は現在 discord.py にいて、bot.py (メイン ファイル) を直接編集するたびに、suggest コマンドのバージョンを実装できます。

@bot.command(name = 'suggest', help = 'Use this command to give a suggestion to the server')
async def suggest(ctx, content):
    channel = discord.utils.get(bot.guilds[0].channels, name = 'suggestions')
    print('Suggest command triggered, content is {}'.format(content))
    await channel.send(content)

^ bot は私のバージョンのクライアントです

これは完全に正常に機能します(コンテンツの最初の単語しか取得できないという事実を除いて、誰かがそれを解決できれば、それもいいでしょう

しかし、歯車にコピーペーストするとき

    @commands.command(name = 'suggest', help = 'Use this command to give a suggestion to the server')
    async def suggest(self, bot, ctx, content):
        print('Suggest command triggered')
        channel = discord.utils.get(bot.guilds[0].channels, name = 'suggestions')
        print('Content is {}'.format(content))
        await channel.send(content)

うまくいきません、誰か助けてくれますか?

4

1 に答える 1