discord.pyでbotに発言をさせたいがアプリケーションが応答しませんでしたと出る

実現したいこと

/say textでtextに書き込んだ内容を発言させる
返信ではなくコマンドを実行したチャンネルで発言させたい

前提

発言は出来ているがエラーが出る

発生している問題・エラーメッセージ

アプリケーションが応答しませんでした

エラー画像

イメージ説明

該当のソースコード

python

1import os 2import discord 3from discord.ext import commands 4from discord import app_commands 5 6bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())7bot.remove_command("help")8 9@bot.event10async def on_ready():11 print("準備完了")12 try:13 synced = await bot.tree.sync()14 print(f"{len(synced)}個のコマンドを同期しました。")15 except Exception as e:16 print(e)17 18@bot.tree.command(name="say", description="発言をさせることができます")19@app_commands.describe(saying_msg="発言したい文字")20async def say(interaction: discord.Interaction, saying_msg: str):21 await interaction.channel.send(f"{saying_msg}")22 23 24my_secret = os.environ['DISCORD_BOT_SECRET']25bot.run(my_secret)

補足情報(FW/ツールのバージョンなど)

replit3.3.0
python3

コメントを投稿

0 コメント