Skip to content
Advertisement

Tag: discord

Discord.py read list

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

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 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

Advertisement