Commit 29b3ea1c authored by Daniel Pérez Fernández's avatar Daniel Pérez Fernández 🕶
Browse files

New plugin /check

- Check your bot's permissions in chat
- Update readme
- Update index for active plugin check
- Update locales to add the translations of "/check" plugin
parent 10396c6e
......@@ -34,6 +34,7 @@ Para que funcione nuestro bot, debemos hacer los siguiente:
|Comandos |Descripción | Ejemplos|
|--------|------------|----------|
|/start |Comando de inicio del bot|/start|
|/check o !check|Comprueba los permisos que tiene el bot en el grupo|/check|
|Bienvenida y despedida|Da la bienvenida y se despide de los usuarios||
|/ban (respuesta + tiempo) |Banea y expulsa al usuario durante un tiempo determinado respondiendo a un mensaje del usuario en cuestión|/ban 1|
|/unban o !unban (respuesta) | Desbanea respondiendo al mensaje del usuario||
......
......@@ -19,6 +19,8 @@ const error = require('./src/settings/log_error');
const kick = require('./src/commands/restrict/kick');
// Essentials -- Imprescindibles
const getids = require('./src/commands/plugins/getids');
// Testing
const check = require('./src/commands/test/check');
// Plugins
if(config.token_imgur != ""){
const imgur = require('./src/commands/plugins/imgur');
......
'use strict';
const app = require('../../settings/app');
app.bot.onText(/^\!check|^\/check/, (msg) => {
var chat_id = msg.chat.id;
app.bot.getMe(chat_id).then((me) => {
app.bot.getChatMember(chat_id, me.id).then(function (user) {
if (user.status == 'member') {
app.bot.sendMessage(chat_id, "No soy admin");
}
if (user.status == 'administrator') {
var bot_permissions = [user.can_be_edited, user.can_change_info, user.can_delete_messages, user.can_invite_users, user.can_restrict_members, user.can_pin_messages, user.can_promote_members];
console.log(bot_permissions);
for (var i = 0; i <= (bot_permissions.length - 1); i++) {
if (bot_permissions[i] == true) {
bot_permissions.splice(i, 1, "");
}
if (bot_permissions[i] == false) {
bot_permissions.splice(i, 1, "");
}
}
app.bot.sendMessage(chat_id, app.i18n.__('⚒ List of my permissions:\n\nI can edit messages: ') + bot_permissions[0] + app.i18n.__('\nI can change the group inforamtion: ') + bot_permissions[1] + app.i18n.__('\nI can delete messages: ') + bot_permissions[2] + app.i18n.__('\nI can add users: ') + bot_permissions[3] + app.i18n.__('\nI can restrict users: ') + bot_permissions[4] + app.i18n.__('\nI can pin messages: ') + bot_permissions[5] + app.i18n.__('\nI can add administrators: ') + bot_permissions[6]);
}
});
});
});
......@@ -52,5 +52,12 @@
"To use the !pin command you need to reply to the message you want to anchor" : "To use the !pin command you need to reply to the message you want to anchor",
"⛔️ Error, the poll has to have a minimum of two options\n Example: /poll Question; Answer 1; Answer 2" : "⛔️ Error, the poll has to have a minimum of two options\n Example: /poll Question; Answer 1; Answer 2",
"🚨 Previously closed poll" : "🚨 Previously closed poll",
"You need to reply to poll message with the command /endpoll" : "You need to reply to poll message with the command /endpoll"
"You need to reply to poll message with the command /endpoll" : "You need to reply to poll message with the command /endpoll",
"⚒ List of my permissions:\n\nI can edit messages: " : "⚒ List of my permissions:\n\nI can edit messages: ",
"\nI can change the group inforamtion: " : "\nI can change the group inforamtion: ",
"\nI can delete messages: " : "\nI can delete messages: ",
"\nI can add users: " : "\nI can add users: ",
"\nI can restrict users: " : "\nI can restrict users: ",
"\nI can pin messages: " : "\nI can pin messages: ",
"\nI can add administrators: " : "\nI can add administrators: "
}
......@@ -52,5 +52,12 @@
"To use the !pin command you need to reply to the message you want to anchor" : "Para usar el comando !pin tienes que responder al mensaje que quieras anclar",
"⛔️ Error, the poll has to have a minimum of two options\n Example: /poll Question; Answer 1; Answer 2" : "⛔️ Error, la encuesta tiene que tener un mínimo de dos opciones.\n Ej: /poll Pregunta; Opción 1 ; Opción 2",
"🚨 Previously closed poll" : "🚨 Encuesta previamente cerrada",
"You need to reply to poll message with the command /endpoll" : "Tienes que responder directamente al mensaje de la encuesta con el comando /endpoll"
}
"You need to reply to poll message with the command /endpoll" : "Tienes que responder directamente al mensaje de la encuesta con el comando /endpoll",
"⚒ List of my permissions:\n\nI can edit messages: " : "⚒ Lista de mis permisos:\n\nPuedo editar mensajes: ",
"\nI can change the group inforamtion: " : "\nPuedo cambiar la información del grupo: ",
"\nI can delete messages: " : "\nPuedo eliminar mensajes: ",
"\nI can add users: " : "\nPuedo añadir usuarios: ",
"\nI can restrict users: " : "\nPuedo restringir usuarios: ",
"\nI can pin messages: " : "\nPuedo anclar mensajes: ",
"\nI can add administrators: " : "\nPuedo añadir administradores: "
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment