Discord.py 建议命令
Discord.py suggestion command
我到处都找过了,没找到答案。我是 discord.py 的新手。我想创建一个 /suggestion 命令以及它存储到 JSON 文件后出现的任何内容。
也许这就是您要找的东西?
@bot.command()
async def suggest(msg,*,user_suggestion):
file=open(r"E:\Test12\Testing\hello.json",'r')
data=json.load(file)
data.append(user_suggestion)
with open(r"E:\Test12\Testing\hello.json",'w')as f:
f.write(str(json.dumps(data)))
f.close()
await msg.message.add_reaction(emoji='\U00002705')
我到处都找过了,没找到答案。我是 discord.py 的新手。我想创建一个 /suggestion 命令以及它存储到 JSON 文件后出现的任何内容。
也许这就是您要找的东西?
@bot.command()
async def suggest(msg,*,user_suggestion):
file=open(r"E:\Test12\Testing\hello.json",'r')
data=json.load(file)
data.append(user_suggestion)
with open(r"E:\Test12\Testing\hello.json",'w')as f:
f.write(str(json.dumps(data)))
f.close()
await msg.message.add_reaction(emoji='\U00002705')