discord.py-rewrite

Discord.py-Rewrite Sending an Error message when there is an unknown command or other error

≡放荡痞女 提交于 2020-12-15 01:55:38
问题 I want to be able to send a message like await ctx.send("Error: Unknown command. Do -help for acceptable commands." or something like that (FYI, I'm not asking how to remove the Help is already a defined function or something like that.); But I don't know how to make an error message for something that isn't a command, Like if there is an error with a command like they didn't put any parameters then I'm able to make an error for that @command.error then i define it. But I'm not sure how to

Discord.py-Rewrite Sending an Error message when there is an unknown command or other error

試著忘記壹切 提交于 2020-12-15 01:55:26
问题 I want to be able to send a message like await ctx.send("Error: Unknown command. Do -help for acceptable commands." or something like that (FYI, I'm not asking how to remove the Help is already a defined function or something like that.); But I don't know how to make an error message for something that isn't a command, Like if there is an error with a command like they didn't put any parameters then I'm able to make an error for that @command.error then i define it. But I'm not sure how to

Discord.py - Changing prefix with command

亡梦爱人 提交于 2020-12-09 06:02:30
问题 I want to make a command where an admin can change the prefix for commands (eg: instead of using "." they can change it to "-" and only "-" will work if they do) I'd be able to setup the permissions to make only admins able to use the command I've looked around, through the docs & interwebs but haven't found anything and I haven't had any idea on how to do this 回答1: You should use the command_prefix argument for discord.Bot this accepts either a string (meaning one bot wide prefix) or a

Discord.py welcome bot on_member_join event not getting callded

强颜欢笑 提交于 2020-11-25 03:56:25
问题 I've been interested in working with discord bots lately, and from what I'm seeing this code should work but it is not... I'm simply just playing around with the API because it's fun so I'm pretty new with this. I just want the bot to welcome someone when they join. import discord client = discord.Client() @client.event async def on_ready(): print('We have logged in as {0.user}'.format(client)) channel = client.guilds[0].get_channel(CHANNEL ID) await channel.send("Bot online") @client.event