Automod command

This code should be creating a automod rule and selecting a log channel, it creates the rule but doens't select the log channel, i tried to log it and thats what i got Code - https://sourceb.in/lQniYe80Y8 logChannel log - https://sourceb.in/T1ebYc9oBR
No description
31 Replies
d.js toolkit
d.js toolkit2mo ago
- 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 OP
Melo
Melo2mo ago
@Shook that wayy?
T
T2mo ago
yes, hopefully someone can help you soon
Melo
Melo2mo ago
kk
ir
ir2mo ago
have you tried passing logChannel.id instead of just the logChannel?
Melo
Melo2mo ago
you want me to log it or to pass the id in the command?
ir
ir2mo ago
pass the id here
actions: [{ type: 1, metadata: { channel: logChannel.id, durationSeconds: 10, customMessage: `This message was prevented by Atoms' AutoMod.` } }]
actions: [{ type: 1, metadata: { channel: logChannel.id, durationSeconds: 10, customMessage: `This message was prevented by Atoms' AutoMod.` } }]
^ change your current code to this
Melo
Melo2mo ago
done, ill try now didnt work
ir
ir2mo ago
the documentation for action metadata says that you're supposed to pass channel_id into it, not channel. is { channel } autocompleted for you?
No description
Melo
Melo2mo ago
Someone just told me to use channel xD
ir
ir2mo ago
hmmm try { channelId: logChannel.id }
Melo
Melo2mo ago
K Didn’t work
ir
ir2mo ago
give me one second, im gonna try and do this via my bot and see what i can find out
Melo
Melo2mo ago
Aight
duck
duck2mo ago
action type 1 seems to just be for BlockMessage you'd want a separate action of type SendAlertMessage to send an alert message to a channel you'd want to take note of the associated action types here https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-metadata you should also consider using the AutoModerationActionType enum so that your code is readable
Melo
Melo2mo ago
How it would look like with this enum
duck
duck2mo ago
e.g. AutoModerationActionType.BlockMessage
Melo
Melo2mo ago
I had to turn off my pc so it’s harder to work now
duck
duck2mo ago
and to come back to this, since they're using discord.js, this is something to look at the discord.js docs for over the dapi docs the property to use would be channel
Melo
Melo2mo ago
I will need 2 action types right? actions: [{ type: 1, metadata: { channelId: logChannel.id, durationSeconds: 10, customMessage: This message was prevented by Atoms' AutoMod. } }] Just need to know how this line will look like with the 2 action types
duck
duck2mo ago
you would want a separate action not 2 types for the same action each action should be its own object in the array
Melo
Melo2mo ago
How would this look like I’m confused God I hate this iPad keyboard
duck
duck2mo ago
[{}, {}] is an example of 2 objects in an array if you haven't properly learned basic syntax, you may want to brush up on javascript before continuing
Melo
Melo2mo ago
Got it My brain wasn’t braining It worked Tysm @duck @d
rip_star
rip_star2mo ago
how did u join a guild
Melo
Melo2mo ago
Magic
rip_star
rip_star2mo ago
tell pls ive waitlisted
duck
duck2mo ago
Please take the off topic chat elsewhere Though I imagine the way after being put on a wait list would be to wait
Melo
Melo2mo ago
duck, can u help me again? i forgot i had this forum and created another for automod related thingey if ur free can I ping u ?
duck
duck2mo ago
This seems like a redundant question to ask immediately after pinging someone Please take note of #rules 5
Melo
Melo2mo ago
reply pinged? i disabled it.. sorry "i forgot i had this one"