【发布时间】:2021-05-31 11:49:33
【问题描述】:
所以,我尝试制作一个前缀命令,当你这样做时,我试图让它发布到 MongoDB,它不起作用,谁能帮助我? 我没有错误。 :/
这是一个齿轮,只是让你知道。
@commands.command(pass_context=True, aliases=["prefix"])
@commands.has_permissions(administrator=True)
async def changeprefix(self, ctx, prefix):
post = {
'_id': ctx.guild.id,
'prefix': prefix,
}
await self.client.prefixes.upsert(post)
await ctx.send(f'Prefix changed to: {prefix}')
await ctx.guild.me.edit(nick=f"[{prefix}] «y e s bot»")
【问题讨论】:
标签: python mongodb discord.py