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 toolkit7mo 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
MeloOP7mo ago
@Shook that wayy?
S🅰pph
S🅰pph7mo ago
yes, hopefully someone can help you soon
Melo
MeloOP7mo ago
kk
ir
ir7mo ago
have you tried passing logChannel.id instead of just the logChannel?
Melo
MeloOP7mo ago
you want me to log it or to pass the id in the command?
ir
ir7mo 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
MeloOP7mo ago
done, ill try now didnt work
ir
ir7mo 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
MeloOP7mo ago
Someone just told me to use channel xD
ir
ir7mo ago
hmmm try { channelId: logChannel.id }
Melo
MeloOP7mo ago
K Didn’t work
ir
ir7mo ago
give me one second, im gonna try and do this via my bot and see what i can find out
Melo
MeloOP7mo ago
Aight
duck
duck7mo 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
MeloOP7mo ago
How it would look like with this enum
duck
duck7mo ago
e.g. AutoModerationActionType.BlockMessage
Melo
MeloOP7mo ago
I had to turn off my pc so it’s harder to work now
duck
duck7mo 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
MeloOP7mo 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
duck7mo 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
MeloOP7mo ago
How would this look like I’m confused God I hate this iPad keyboard
duck
duck7mo 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
MeloOP7mo ago
Got it My brain wasn’t braining It worked Tysm @duck @d
rip_star
rip_star7mo ago
how did u join a guild
Melo
MeloOP7mo ago
Magic
rip_star
rip_star7mo ago
tell pls ive waitlisted
duck
duck7mo 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
MeloOP6mo 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
duck6mo ago
This seems like a redundant question to ask immediately after pinging someone Please take note of #rules 5
Melo
MeloOP6mo ago
reply pinged? i disabled it.. sorry "i forgot i had this one"
Want results from more Discord servers?
Add your server