@client.eventasync def on_message_delete(message): content = message.content author = message.author await message.channel.send("{}: {}".format(author, content))我搜索了它,但找不到任何結果。我嘗試使用 client.get_channel("id") 它給出了typerror 我嘗試將其轉換為 int 但仍然不起作用。 你能幫我嗎?
1 回答

開心每一天1111
TA貢獻1836條經驗 獲得超13個贊
將檢索到的數據發送到特定的公會和頻道
specific_guild = client.get_guild( guild_id )#guild_id must be a integer
specific_channel = specific_guild.get_channel( channel_id )#channel_id must be a integer
await specific_channel.send("{}: {}".format(author, content))
將檢索到的數據發送到同一行會的特定頻道
specific_channel = message.guild.get_channel( channel_id )#channel_id must be a integer
await specific_channel.send("{}: {}".format(author, content))
添加回答
舉報
0/150
提交
取消