How to make ban command with logs

09/08/2020

Hello and welcome to another tutorial! Today, i will tell you how to make ban command that logs all bans in a specific channel! This one is actually gonna be pretty simple, so let's go!

First of all, we need a variable called "banlogs", or you can call it whatever you want 😁 You can just leave the value as it is.

Now, we will make a command that sets up the channel. This will be just some simple $setServerVar, but if you're not that good at it, paste in the code $setServerVar[banlogs;$message[1]]

Then make the bot checks if the channel ID is valid:

$onlyIf[$charCount[message[1]]==18;This isn't valid ID]

I would also recommend making the bot respond, so you know that it performed the action. Use one of these two codes:

$nomention
$addCmdReaction[👌]


$nomention
$title[Ban]
$description[The ban log channel has been set to <#$message[1]>]
$color[ff0000]

Now let's make the ban command. Of course, start with $nomention. Put in $ban so it bans the person. Then we are gonna make a simple embed:

$title[Ban]
$description[<@$mentioned[1;no]> was banned for: $replaceText[$message;$message[1];;1]]


Now make another command with the same trigger as our ban command. This will be the command that is gonna log the bans. Put in $useChannel[$getUserVar[banlogs]] so the following message will be sent in the channel that we set up with the command that was the 1st that we made. Now just put in the embed that we specified earlier and that's it! If you have any problems with this command, ping me (tobiagamesyt#5852) in the official BDFD server! See you in the next article!

Thumbnail of this article
Thumbnail of this article
Create your website for free! This website was made with Webnode. Create your own for free today! Get started