mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 04:39:57 +00:00
Added logs to some commands on crew
This commit is contained in:
parent
e2e93ef35e
commit
aa79bf3ceb
@ -63,11 +63,18 @@ module.exports = (bot) => {
|
||||
const userId = ctx.from.id || Strings.unKnown;
|
||||
if (Config.admins.includes(userId)) {
|
||||
const botName = ctx.message.text.split(' ').slice(1).join(' ');
|
||||
const botNameReport = Strings.botNameChanged.replace({botName}, botName);
|
||||
ctx.telegram.setMyName(botName).catch(error => ctx.reply(
|
||||
"Error when changing bot name:\n" + error, {
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
}
|
||||
));
|
||||
ctx.reply(
|
||||
botNameReport, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
}
|
||||
);
|
||||
} else {
|
||||
ctx.reply(Strings.botAdminOnly, {
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
@ -80,11 +87,18 @@ module.exports = (bot) => {
|
||||
const userId = ctx.from.id || Strings.unKnown;
|
||||
if (Config.admins.includes(userId)) {
|
||||
const botDesc = ctx.message.text.split(' ').slice(1).join(' ');
|
||||
ctx.telegram.setMyName(botDesc).catch(error => ctx.reply(
|
||||
const botDescReport = Strings.botDescChanged.replace({botDesc}, botDesc);
|
||||
ctx.telegram.setMyDescription(botDesc).catch(error => ctx.reply(
|
||||
"Error when changing bot description:\n" + error, {
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
}
|
||||
));
|
||||
ctx.reply(
|
||||
botDescReport, {
|
||||
parse_mode: 'Markdown',
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
}
|
||||
);
|
||||
} else {
|
||||
ctx.reply(
|
||||
Strings.botAdminOnly, {
|
||||
|
@ -10,6 +10,8 @@
|
||||
"botAdminOnly": "This command is exclusive to the bot's general administrators. I can't disclose who they are, nor what this command does.",
|
||||
"privateOnly": "This command should be used only on private chats, and not on groups.",
|
||||
"groupOnly": "This command should be used only on groups, and not on private chats.",
|
||||
"botNameChanged": "*Bot name changed to* `{botName}`",
|
||||
"botDescChanged": "*Bot description changed to* `{botDesc}`",
|
||||
"invalidId": "Please enter a valid user ID.",
|
||||
"banSuccess": "User with ID `{userId}` has been banned.",
|
||||
"banErr": "Could not ban the user. Please check if the ID is correct and if the bot has admin permissions.\n\n{tgErr}",
|
||||
|
@ -10,6 +10,8 @@
|
||||
"botAdminOnly": "Esse comando é exclusivo a administradores gerais do bot. Não posso informar quem são, e nem o que esse comando faz.",
|
||||
"privateOnly": "Esse comando deve ser utilizado apenas em chats privados, e não em grupos.",
|
||||
"groupOnly": "Esse comando deve ser utilizado apenas em grupos, e não em chats privados.",
|
||||
"botNameChanged": "*Nome do bot alterado para* `{botName}`",
|
||||
"botDescChanged": "*Descrição do bot alterada para* `{botDesc}`",
|
||||
"invalidId": "Por favor, insira um ID de usuário válido.",
|
||||
"banSuccess": "Usuário com ID `{userId}` foi banido.",
|
||||
"banErr": "Não foi possível banir o usuário. Verifique se o ID está correto e se o bot tem permissões de administrador.\n\n`{tgErr}`",
|
||||
|
Loading…
x
Reference in New Issue
Block a user