mirror of
https://github.com/System-End/Discord-Bot.git
synced 2026-04-19 16:28:26 +00:00
fixed ban urself
This commit is contained in:
parent
9d79758569
commit
c954cfa00d
1 changed files with 10 additions and 4 deletions
|
|
@ -3,15 +3,22 @@ const Discord = require('discord.js');
|
|||
const Schema = require('../../database/models/userBans');
|
||||
|
||||
const webhookClientLogs = new Discord.WebhookClient({
|
||||
id: "",
|
||||
token: "",
|
||||
id: "",
|
||||
token: "",
|
||||
});
|
||||
|
||||
module.exports = async (client, interaction, args) => {
|
||||
const boolean = interaction.options.getBoolean('new');
|
||||
const member = interaction.options.getUser('user');
|
||||
|
||||
|
||||
if (boolean == true) {
|
||||
if (member.id === interaction.user.id) { // add the check here
|
||||
return client.errNormal({
|
||||
error: `You cannot ban yourself from the bot`,
|
||||
type: `editreply`
|
||||
}, interaction);
|
||||
}
|
||||
|
||||
Schema.findOne({ User: member.id }, async (err, data) => {
|
||||
if (data) {
|
||||
return client.errNormal({
|
||||
|
|
@ -79,4 +86,3 @@ module.exports = async (client, interaction, args) => {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Reference in a new issue