Merge pull request #107 from OpAayush/patch-10

fixed ban urself
This commit is contained in:
Corwin 2023-02-14 11:39:49 +01:00 committed by GitHub
commit a3d8ecebfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) => {
}
}