I’ve designed a system to loop through all the channels and check to see if the last few messages are the same as they were at the previous check, but that’s slow and unnecessary. If there’s any way to do it through a function, or a simpler, faster way, let me know. Thanks! Answer You can use the event on_message,
Tag: bots
How do I embed a response? Discord Bot Python
This is the code I have and I was wondering how do I make it so that the bot embeds the requirements. Answer Here:
Discord.py WELCOMER – How to make a custom image for welcome messages
I’d like to add the “custom” image for new discord users in my server. Just like this: Click here for the image. This is what I have for now: Answer You need to use an image processing/manipulation library called pillow aka PIL. You’d have your default/template image, as you provided (without the user specific text). You’d then find the position
Translation in discord.py bot doesn’t work
I’ve been trying to make my discord bot translate texts using a module called googletrans. It seems fairly simple and it should have worked without any hassle, or so I thought. So after my import statements, I have translator = Translator(). My following cog code is: But it shows this error: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: ‘NoneType’ object has
How to add timeout, python discord bot
I made a guess the character game in discord bot, (see the code below). I want to add 30 second timeout for a player to response, but I totally dont know what to do, any help? Answer You should add timeout = seconds criteria in wait_for
Am I using the on_guild_leave function correctly?
So I looked at many sources saying that on_guild_leave is how it is used, but I can’t get it to work. Here is my code: Can anyone seem to help? on_guild_join works, but on_guild_leave doesn’t. Answer on_guild_leave doesn’t exist, use on_guild_remove instead. Docs for on_guild_remove
How can I make the bot say something when someone tries to kick a higher admin or himself?
When someone tries to kick a higher in rank admin the bot does nothing not even an error, I want it instead to return a text into chat. Also if someone tries to kick/ban himself it works, how can I disable that? Thanks here is the code Answer you can compare top_role of the members
Cooldowns, reactions and few more problems with discord.py
Im creating a discord bot in python and i have few problems i would like to get a help with. 1. I would like to know how to add cooldown on a command. So for example someone will use a command and everyone will not be able to use the same command for some amount of time. Here is one
How do I reference “*args” in a discord bot’s code as a message for the bot to send?
This is my code: client.say(output) does not work, but I tried to do it in this form: await message.channel.send(output) However, I don’t know what to put for message as my function’s parameter is *args Is there a something else I can put as the message? Answer Firstly, you need to have a parameter for your command so that context can