好的,我的目标的基本jist是尝试给我一个可管理的列表,以帮助在discord服务器中组织主题名称。我的代码应该允许我查看列表编辑列表并再次显示。当我的bot试图通过发送更新的列表时,会出现问题。这是我的代码和问题
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = '/')
FreeExtras = []
@client.command()
async def Free0(ctx):
await ctx.send(FreeExtras)
@client.command()
async def addextra(ctx):
name = await client.wait_for('message',check=lambda m: m.author == ctx.author and m.channel == ctx.channel)
FreeExtras.append(name)
当我在编辑我的bot后尝试显示列表时,会发送以下消息:
[<Message id=804880602042073118 channel= type=<MessageType.default: 0> author=<Member id=306814779358445570 name='Gundamn' discriminator='0657' bot=False nick=None guild=> flags=>]
wait_for('message')
返回一个Message
对象,您需要通过.content
附加它的content
相关问题 更多 >
编程相关推荐