前提
Discord.pyのAPIリファレンスを見てコードを書きましたが思ったように動きません。
実現したいこと
・Discord.pyを使ってBOTのカスタムステータスのアクティビティを変更
発生している問題・エラーメッセージ
カスタムステータスのアクティビティの変更はされませんがエラーメッセージは出ません。
ゲームステータスにしたら変更されます。
該当のソースコード
Python3
1import discord 2client = discord.Client(intents=discord.Intents.all()) 3@client.event 4async def on_ready(): 5 print("起動した") 6 7@client.event 8async def on_message(message): 9 if message.content.startswith("t/sm"): 10 msg=message.content 11 stmsg=(msg.removeprefix("t/sm ")) 12 await client.change_presence(status=discord.Status.online, activity=discord.CustomActivity(name=str(stmsg))) 13 14client.run("TOKEN")
試したこと
wait client.change_presence(status=discord.Status.online, activity=discord.CustomActivity(name=str(stmsg)))
の部分を色々試行錯誤しましたが、どれもできませんでした。
補足情報(FW/ツールのバージョンなど)
OS = Windows10
Python 3.10.5
discordpy 2.0.1

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