I have a slight issue with my code and im not sure

I’ve just started learning python and wanted to make a discord bot hoping to learn some coding on the way. Right now im trying to make a chatbot and im facing an issue. from prsaw import RandomStuff rs = RandomStuff(async_mode = True) Code: @client.event async def on_message(message): if client.user == message.author: return if message.channel.id ==… Read More I have a slight issue with my code and im not sure

Python variable gives me the name of the user then changes to all its info

I’m coding a Discord bot in Python, and I’m trying to get a user name by his ID. So this is what I have: ok = ctx.message.guild.get_member(313628621841498114) print(ok) #prints Thomsd#4688 This is indeed what I’m trying to get. However, when I do dict_temp = {"membres":ok} print(dict_temp) I get: {‘membres’: <Member id=313628621841498114 name=’Thomsd’ discriminator=’4688′ bot=False nick=None… Read More Python variable gives me the name of the user then changes to all its info

How to make @commands.cooldown go for days and months instead of seconds Discord.py

I want to make a command for daily rewards for discord.py economy. I have the code but the problem is is that it displays in secounds @client.command(aliases=[‘d’]) @commands.cooldown(1, 86400, commands.BucketType.user) @is_registered async def daily(ctx: commands.Context): random_amount = random.randint(50, 150) await economy.add_money(ctx.message.author.id, "wallet", random_amount) embed = discord.Embed( colour=discord.Color.from_rgb(244, 182, 89) ) embed.add_field(name=f"Reward", value=f"Successfully claimed daily!") await… Read More How to make @commands.cooldown go for days and months instead of seconds Discord.py

How to list all of my bot guild names near the ids discord.py

How to list all of the guild ids and names instead of one? @client.command() async def guilds(ctx): for guild in client.guilds: em=discord.Embed(title="GUILD IDS",description=f"{[guild.name + ‘ : ‘+ str(guild.id)]}") await ctx.send(embed=em) >Solution : You can use something like this: @client.command() async def commandname(ctx): listGuild = [] for guild in client.guilds: listGuild.extend([guild.id, guild.name]) print(listGuild)

How to get the command name when a command not found error occurs discord.py

I have made an event called on_command_error which intercepts the orginal command error. In that event it sends to the channel the command was executed in. "The command you have executed is not found". I want it to be able to say. "The command {commandname} has not been found". I don’t know how to get… Read More How to get the command name when a command not found error occurs discord.py

AttributeError: 'str' object has no attribute 'get' random stuff api python

I am trying to make an AI Chatbot using the Random stuff api and whenever I try to make one, I always get this error (I am using replit.com to host): Traceback (most recent call last): File "main.py", line 5, in <module> response = client.get_ai_response("Hi there!") File "/home/runner/ChatBot/venv/lib/python3.8/site-packages/randomstuff/client.py", line 254, in get_ai_response message=response[0].get(‘response’), AttributeError: ‘str’… Read More AttributeError: 'str' object has no attribute 'get' random stuff api python

Can someone help me with this error that im getting?

I’m trying to make a crypto command but its giving me an error.I tried doing everything i can’t seem to fix it. If anyone fixes it please mention how you fixed it i need to learn how cause i get these errors very frequently. This is the code: @client.command(pass_context=True) async def ethprice(ctx): response = requests.get(‘https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD&#8217;)… Read More Can someone help me with this error that im getting?