I get this error on my bot when mentioning a role,here is the error, raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: unhashable type: ‘set’ my code: What’s meant to happen: Me:-war Bot:Are you sure Me:reacts Bot:Type in role Me:(role name) Bot:…. Answer is a set literal for a set containing a number. discord.py is using hashing under
Tag: discord.py
Python discord bot using discord.py problem
I’m trying to make a discord bot using the module discord.py, but I’m running into an issue and I’m unable to fix it. What I’m trying to do is that when someone pings the bot, he answers his prefix, I got that working with : However none of the code after that works: , so I cannot use any commands
Discord.py – which way should I pick? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about programming within the scope defined in the help center. Closed 1 year ago. Improve this question Recently I’ve known that developers are able to code Discord.py bot in 2 ways (or even more): To code every command
Bot will not log an automod event if user has blocked the bot
If someone says a bad word that triggers the automod, the bot will delete the message, DM the user, and log it in a log channel. The problem is if someone blocks the bot and says a bad word, the bot can’t DM the user which doesn’t allow the bot to log the event in a log channel. I tried
How do I listen for new chat messages in text channels using a discord bot in python?
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,
Get all messages sent by a specific user in a channel/server – Discord.py
I’m trying to figure out a way to get all messages sent by a specific user in a channel and/or the whole server (would probably take a while for that). I have also looked into User.history() and Member.history(), but despite the documentation not mentioning it, it will only return a User’s DM history. Here is the Bot Command code snippet:
(discord.py) Get user’s, last message from a JSON file without specifying the name/id
I have an users.json file which store the user’s id and lmessage (current date,time) if he is write in a room. How can I get all of these IDs and the lmessages which belongs to that ID without specify username or anything? Currently I can get the user’s lmessage with a command if I specify the username: Answer If I
Why is my cooldown sending even when there is no cooldown? discord.py
So I am attempting to create a cooldown for one of my commands. (The command) My issue is that the cooldown text is sent right after the message despite the command not being sent twice. (The command error event) Extra information you may need: (Opens json files for use) (Closes json files and saves them) (Imports) Example of the issue:
the embed do not send and i didint have errors
i dont have errors and the embed didint send Answer I would recommend you a better division to minimize the sources of errors. The best way is to define an embed. Have a look at the following code: Also pay attention to proper indentation, possibly too many spaces, etc. Maybe also have a look at the docs and how to
How to make a bot join a channel and respond in chat discord.py
I just started learning to code very recently in order to make a discord bot in python. I have used both pieces of code separately and they have worked, but when trying to use them together only the messages work, and the bot will not join the voice channel. No errors come up when I type the join command. However,