@bot.command(name='setannounce')
async def setannounce(context, *, arg2):
with open("data2.json", "w+") as f:
json.dump(arg2, f, indent=2)
setannounce = arg2
@bot.command(name='announce')
async def announce(context, *, arg1):
embed = discord.Embed(title="**OpticPvP**", description="", color=0xc94747)
embed.add_field(name="Announcement", value=arg1 , inline=False)
embed.set_footer(text="Optic Development")
try:
inchan = bot.get_channel(announceChannel)
await inchan.send(embed=embed)
except NameError:
await context.send('Announcement channel is not set, please use `.setannounce <channel id>')
所以基本上我想要它,所以在discord中我可以做。setannounce是一次设置,如果我做了,可能是一次更新。setannounce<;频道id2>;它将覆盖第一个频道id。提前感谢:)
相关问题 更多 >
编程相关推荐