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
31 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 OP@Shook that wayy?
yes, hopefully someone can help you soon
kk
have you tried passing
logChannel.id
instead of just the logChannel?you want me to log it or to pass the id in the command?
pass the id here
^ change your current code to this
done, ill try now
didnt work
the documentation for action metadata says that you're supposed to pass channel_id into it, not channel. is
{ channel }
autocompleted for you?Someone just told me to use channel xD
hmmm try
{ channelId: logChannel.id }
K
Didn’t work
give me one second, im gonna try and do this via my bot and see what i can find out
Aight
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 readableHow it would look like with this enum
e.g.
AutoModerationActionType.BlockMessage
I had to turn off my pc so it’s harder to work now
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
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 typesyou would want a separate action
not 2 types for the same action
each action should be its own object in the array
How would this look like
I’m confused
God I hate this iPad keyboard
[{}, {}]
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 continuingGot it
My brain wasn’t braining
It worked
Tysm @duck @d
how did u join a guild
Magic
tell pls
ive waitlisted
Please take the off topic chat elsewhere
Though I imagine the way after being put on a wait list would be to wait
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 ?
This seems like a redundant question to ask immediately after pinging someone
Please take note of #rules 5
reply pinged? i disabled it..
sorry
"i forgot i had this one"