前提
今Discord.pyでコマンドを作っているのですが、
前まで実行できていたコマンドが実行できなくなってしまいました。
Discord側もそのBOTのコマンド一覧(?)みたいなところを見ても
そのBOTのだけコマンドが一切表示されず、
一切何もできないです。
"hi"と打ったら"hi"と打つ応答するのはできたので
BOTは起動とかはできているようです。
実現したいこと
コマンドが実行できるようにしたいです
該当のソースコード
python
1import discord 2from discord.ext import commands 3 4bot = commands.Bot(intents=discord.Intents.all(), command_prefix="/") 5 6@bot.command() 7async def help(ctx): 8 await ctx.send("help") 9 10@bot.command() 11async def ban(ctx, member : discord.Member, *, reason = None): 12 await member.ban(delete_message_days=7, reason=reason) 13 await ctx.send("baned") 14 15@bot.event 16async def on_ready(): 17 print('login{0.user}'.format(bot)) 18 await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name ="Youtube")) 19 20@bot.event 21async def on_message(message): 22 if message.author.bot: 23 return 24 if message.content == "hi": 25 await message.channel.send("hi") 26bot.run("TOKEN here")
試したこと
一度パッケージがおかしいかもと思って
再インストールしてみたりしました
補足情報(FW/ツールのバージョンなど)
python : 3.10.8
discord.py : 2.0.1

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/12/23 08:10