I have a file with a list called wbanned.txt which contains forbidden words. I want every message sent to be read and if it contains one of the forbidden words in the txt list (Every word is on a new line from list) to be deleted. I tried something but all it does is delete it only if it contains
Tag: discord
Discord malware
Someone contacted me with a problem regarding Discord. The code below was brought to my attention as it was run around the time the problems began. Windows asks what program the code below should be run with and the default is Discord. Every time Discord is run, this chunk of code is run: Any idea what this could be? I
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
how i can count members in python i need full code
i want to count members in discord but how using async await message.channel.send(f”””# of Members: {id.member_count}”””) i try i know this is copy code my code is Answer To get the amount of members from a guild can be retrieved with member_count, with this you also need to properly define guild or just simply using ctx.guild.member_count This is an example
Discord py cryptocurrency API command not working
I have a command that is supposed to get the price of a given cryptocurrency but it’s not working. Heres the code: When I run the command it triggers the Invalid cryptocurrency or API error. Answer Execute your code, line by line then you will see the error. usdprice = json_stats[“usd”] will always return an error. Do something like usdprice
Discord.py commands always says as existing command, even when it’s completely random
I’m trying to write a Discord bot in discord.py that just responds to commands, like when you type =!firewall it says Hello! Here’s my code: However, when I try to run the command with =!firewall in Discord, the console returns this: As it is pretty obvious, chickennuggets is not a default command, nor a command used by any other libraries
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
I am struggling with dming members with a certain role in discord.py
Here’s the code and then DMing I have already tried same thing with IDs, but no progress It says the error Answer I believe your problem is you are using server, as it is not defined, it is giving you an error AttributeError: ‘Message’ object has no attribute ‘server’ and it states it is not an attribute of message. red_role
Discord.py ctx commands not responding
None of my ctx commands work. Here I’ll give an example. When I say p!test I want it to print hi and say test, but it’s not responding. Can someone help? Answer If you’re using a on_message event, you have to ‘process commands’ in the last line of the event. Otherwise, your commands won’t work. Reference discord.ext.commands.Bot.process_commands
Discord Python Allow one user to identify another within command
I’m working on a bot for discord that tracks information related to a game. I would like staff members to alter the data of regular players with a bot command. Is there a way to grab the mention out of the command? &do_thing @target specifics I’m familiar with extracting the nickname and discord ID for the author. I need to