mirror of
https://github.com/SrIzan10/vinci.git
synced 2026-06-06 01:07:00 +00:00
feat: kick command
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
TOKEN=token
|
||||
PREFIX=v!
|
||||
ECONOMY_MONGODB=mongodb://
|
||||
ECONOMY_MONGODB=mongodb://
|
||||
HYPIXEL_API=API_KEY
|
||||
@@ -4,7 +4,7 @@ vinci bot
|
||||
- ~~form to apply for the minecraft server~~ DONE!
|
||||
- moderation commands
|
||||
- ~~welcome to users~~ DONE!
|
||||
- economy system (wip)
|
||||
- economy system
|
||||
- modmail
|
||||
- socials notification system
|
||||
- chatbot using IBM's AI (thanks @gosevil for the idea)
|
||||
|
||||
37
commands/kick.ts
Normal file
37
commands/kick.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import { publish } from "../src/plugins/publish";
|
||||
import { ownerOnly } from "../src/plugins/ownerOnly";
|
||||
import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js'
|
||||
|
||||
export default commandModule({
|
||||
name: 'kick',
|
||||
type: CommandType.Both,
|
||||
plugins: [publish(['1000400148289036298', '928018226330337280']), ownerOnly()],
|
||||
description: 'ADMIN: Expulsa usuarios.',
|
||||
options: [{
|
||||
name: 'usuario',
|
||||
description: 'Escribe un usuario.',
|
||||
type: ApplicationCommandOptionType.User,
|
||||
required: true,
|
||||
min_value: 2,
|
||||
max_value: 100
|
||||
},
|
||||
{
|
||||
name: 'razon',
|
||||
description: 'Escribe la razón.',
|
||||
type: ApplicationCommandOptionType.String,
|
||||
required: true
|
||||
}],
|
||||
//alias : [],
|
||||
execute: async (ctx, options, message) => {
|
||||
const userToBan = options[1].getMember('usuario', true);
|
||||
const reason = options[1].get('razon', true).value;
|
||||
const kickEmbed = new EmbedBuilder()
|
||||
.setTitle('Nuevo kick.')
|
||||
.setDescription(`Kick efectuado por <@${ctx.author}>.\nRazón: ${reason}.`);
|
||||
const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257')
|
||||
await sendToMods.send({content: `Se ha expulsado a ${userToBan}.\nKick efectuado por ${ctx.user} con razón "${reason}."`})
|
||||
userToBan.kick(reason)
|
||||
await ctx.reply({content: 'Expulsado correctamente!'})
|
||||
},
|
||||
});
|
||||
@@ -22,6 +22,5 @@ export default commandModule({
|
||||
// si no dice ni sí ni que no, le decimos al usuario que envíe de nuevo el formulario con sí o no.
|
||||
await modal.reply({content: '**ERROR: No se ha enviado el formulario porque no has respondido ni sí ni no.**\nVuelve a intentarlo o notifica este error mencionando a Sr Izan en el servidor.', ephemeral: true})
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
9
index.ts
9
index.ts
@@ -1,22 +1,13 @@
|
||||
import { SernEmitter } from "@sern/handler";
|
||||
const { EconomyManager } = require('quick.eco');
|
||||
const { Client, GatewayIntentBits } = require("discord.js");
|
||||
const { Sern } = require("@sern/handler");
|
||||
const dotenv = require("dotenv").config();
|
||||
const sernPrefix = process.env.PREFIX
|
||||
const token = process.env.TOKEN
|
||||
const mongo = process.env.ECONOMY_MONGODB
|
||||
const client = new Client({
|
||||
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers],
|
||||
restTimeOffset: 0
|
||||
});
|
||||
/*const eco = new EconomyManager({
|
||||
adapter: 'mongo',
|
||||
adapterOptions: {
|
||||
collection: 'money', // => Collection Name
|
||||
uri: mongo // => Mongodb uri
|
||||
}
|
||||
});*/
|
||||
|
||||
Sern.init({client,
|
||||
sernPrefix,
|
||||
|
||||
889
package-lock.json
generated
889
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -21,11 +21,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/SrIzan10/vinci#readme",
|
||||
"dependencies": {
|
||||
"@quick.eco/mongo": "^1.0.4",
|
||||
"@sern/handler": "^1.1.7-beta",
|
||||
"@sern/handler": "^1.1.8-beta",
|
||||
"axios": "^0.27.2",
|
||||
"discord.js": "^14.0.3",
|
||||
"date-and-time": "^2.4.1",
|
||||
"discord.js": "^14.1.2",
|
||||
"dotenv": "^16.0.1",
|
||||
"quick.eco": "^6.0.0"
|
||||
"mongoose": "^6.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
0
schemas/balance.ts
Normal file
0
schemas/balance.ts
Normal file
Reference in New Issue
Block a user