How to make modlogging when user got timeout and unmute(remove timeout) using audit log events
I want to make a modlogging system when user got timeout and unmute and the bot have to send log in a specific channel using audit log events
42 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPLog the event : guildAuditLogEntryCreate
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
You can also use the voiceStateUpdate
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
What is the event for timeout and unmute I can't get that
I believe for timeout you can get it in the guildMemberUpdate
But i'm sure you getting it in the log
I already tried the guildMemberUpdate event , I want to log the particular timeout and remove timeout event , so is there any particular data entry for it
You can remove it with the <guildmember>.timeout(null,reason)
Just listen to the events and look which one trigger.
I already have timeout, unmute commands , but I don't know the logging functions
When someone getting muted, in the auditlog you have an executor and a target
So then
I got this @Axiprime
Now I want to log this so what should I do
Add a listener to this event
log what happen when you mute someone
You get all the info
What kind of
guildAuditLogEntryCreate is the event
Then >
bro..
You want to know when someone is muted,
Bro I am new at this
Just log and see what it return.
Can you give me the code ?
You dont have your own bot ?
I have
Lemme give you the mute.js file
I'm not gonna open it ^^
put it on pastebin or something
Copy paste using ```
Wait
I also not gonna build the hole thing for you.
Look at the guide : https://discordjs.guide/#before-you-begin if you like to set-up some basic event listener
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Kk, no yt videos regarding this
So that's why I am here
Look at all the link i'm provinding you.
Kk thanks
@polarwolvinny ❄ 🌈 may I know the Aduit Logs event for timeout and unmute ?
there is no even5
You have to filter it out
I try this and got every thing
@Axiprime bro problem solved thats for suggesting me to do console log everything
first of all, use the above guides to create an event handler
and second, make sure you have the intent
which is GuildModeration
i did all the things and its working fine
how to get the timeout duration with "const { action, executorId, targetId, reason } = auditLog;" ?
for that you can also just use
what ?
what is the name for that to be added in { action, executorId, targetId, reason } ?
@polarwolvinny ❄ 🌈 please tell me how to implement that ?
can you not ping me for every reply. And if you just want the timeout, you're better off listening fornthe guildMemberUpdate event and checking there. If you do want to use audit logs, log it and see what it returns
k thanks