Ive been trying to figure this out since im pretty new to coding, the code im trying to do is whenever the owner, admin, moderator and minimod reply to a user's message with "?dm" (short for delete message) it will delete the message you replied to. Example: if an admin replies to a user message with the command "?dm" it will delete the replied message.
#๐ Delete specific Message Code
21 messages ยท Page 1 of 1 (latest)
@lost turret
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
anybody here?
hopefully someone could help
?
in ctx there should be a field for the message it replies to, then you can just delete that message
dispy docs are your best friend
ohh thanks
this is what it says AttributeError: 'Intents' object has no attribute 'message_references'
you need to enable the intent for it (just do intents.all() in your bot intents)
intents = discord.Intents.default()
intents.message_references= True
client = bot.Bot('-', intents=intents)
"client" is not defined
bro that's just and example client is just the name i used for my bot
i mean to say this is how you set intents for your bot
ohh sorry
the code works but when i save the script and relaunch visual code it doesnt work unless i delete the code and paste it again how do i fix that
i dont use vscode
ohh
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.