İ'm Getting this error i try use example bot some user but getting this error when type help
AttributeError: 'Message' object has no attribute 'guild'
Please help also getting this error
also so much error getting more on hastebin https://hastebin.com/ipalesajus.sql
Message documentation.
Based on the documentation stated, there is no guild property in Message. I believe what you are looking for is the server property instead.
(Instead of Message.guild, use Message.server)
Note that it might return a None if the message was in a DM, etc.
Based on that, the example bot is probably suited for older versions of Discord.py instead. You might have to make a few edits to the bot to match up with the newest version.
Also, make sure that you downloaded the library/API the example bot used too.
Related
I've looked all over and I can't find a solution.
I'm using discord js using non-slash commands.
How could I make it so you have a message from the bot and if someone types in the channel the bot's message will get deleted and resent
I want to do this in a sense of a server request channel so you need to add the channel you want the command to run and what you want it to say:
e.g:
Stickied Message
Name:
Request Needed:
Approved By:
how could I program that? Thanks :) <3
I ahve googled online and can't see anything relating to this topic - maybe I'm not searching the right things?
Tried Discord.js V13 | Sticky Message but did not work
I'm using Discord.js to write a bot with a number of helpful commands, however I can't seem to find anywhere on either Discord's API docs or Discord.js' docs that lists an example of the json structure for a slash command's role and channel options. I have the commands registering properly, but don't know what sort of data those interactions give me.
TL;DR: what data is returned when I call the following:
interaction.options.getChannel("channelOptionName")
//and
interaction.options.getRole("roleOptionName")
I'm not able to run any code in any reasonable amount of time, so I'm not able to just console.log it and go from there.
Thanks in advance!
I was making a mute/unmute command for my bot, but every time I type it out, it won't work. Please help me.
If you are using a forked version of discord.py, You can use the timeout function on the member object (new feature and is not supported by discord.py as it was discontinued)
However, if you are on discord.py, you can assign and un-assign mute roles after grabbing the member object.
I like using webhooks, and I think they work amazing, but what I can't figure out is giving a webhook a certain name for just one message.
You can do it by setting username in the JSON you send to Discord. The full documentation is available here: https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params
I have a bot with which you have to verify yourself to be on our Discord server
(The verification takes place in the DM`s)
Recently we have the problem that certain members of our Discord cannot write to the bot.
Everyone allowed everyone to send a message to the person
Each of the people is on our Discord Server, allows the person to write messages and have not blocked the bot
The bot does not issue any error messages
We would be delighted to find a quick solution
Since you haven't provided any code snippets, logs or error messages, it's a bit difficult to assess your situation... but here are some basic troubleshooting steps that you could follow:
Remove and re-authenticate the bot into the server.
Double check that you have enabled DM's.
Check the console for any errors that could pertain to direct messaging issues with users in the server. (especially from successful DM's)
Try to notice any differences between the users in the server who are
able to message the bot, versus those who cannot.
Ensure the bot isn't running more than one instance. (i.e. you might
have more than one bot running on the same token!)
I highly recommend giving more detail, because usually a question pertaining to broken/lost functionality would usually attach code or error logs to help diagnose the issue.
Okay, the problem is that you either didn't enable DMs or the bot is not in the server.
Otherwise, this problem will not occur.