Added logs to some commands on crew

This commit is contained in:
lucmsilva651 2024-07-29 13:30:31 -03:00
parent e2e93ef35e
commit aa79bf3ceb
No known key found for this signature in database
GPG key ID: D9B075FC6DC93985
3 changed files with 19 additions and 1 deletions

View file

@ -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, {