Skip to content
Advertisement

Tag: discord.py

get only information of a specific guild

Hey so this code works completely fine but my problem is that it gets info of all the servers that the bot is in. This code is for logs so I want it to have different logs for each server. For example, I don’t want to show a server that I’m not in if I changed avatar or anything. Any

on_guild_join data doesn’t save on my database

I test-ran my code using on_guild_join to fetch data from a server it joined and save it in a specific db file, but when I checked that, it was empty, no data was saved in it. I checked that on_guild_join part was working, and gave all intents. Here’s the code: class for command ‘execute’, ‘multiexec’: Answer In Sqlite3 you need

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

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

Advertisement