Fixed replaces on setbotname and setbotdesc

This commit is contained in:
Lucas Gabriel 2024-07-29 13:37:49 -03:00
parent aa79bf3ceb
commit ac11b53619
No known key found for this signature in database
GPG Key ID: D9B075FC6DC93985

View File

@ -63,7 +63,7 @@ module.exports = (bot) => {
const userId = ctx.from.id || Strings.unKnown; const userId = ctx.from.id || Strings.unKnown;
if (Config.admins.includes(userId)) { if (Config.admins.includes(userId)) {
const botName = ctx.message.text.split(' ').slice(1).join(' '); const botName = ctx.message.text.split(' ').slice(1).join(' ');
const botNameReport = Strings.botNameChanged.replace({botName}, botName); const botNameReport = Strings.botNameChanged.replace('{botName}', botName);
ctx.telegram.setMyName(botName).catch(error => ctx.reply( ctx.telegram.setMyName(botName).catch(error => ctx.reply(
"Error when changing bot name:\n" + error, { "Error when changing bot name:\n" + error, {
reply_to_message_id: ctx.message.message_id reply_to_message_id: ctx.message.message_id
@ -87,7 +87,7 @@ module.exports = (bot) => {
const userId = ctx.from.id || Strings.unKnown; const userId = ctx.from.id || Strings.unKnown;
if (Config.admins.includes(userId)) { if (Config.admins.includes(userId)) {
const botDesc = ctx.message.text.split(' ').slice(1).join(' '); const botDesc = ctx.message.text.split(' ').slice(1).join(' ');
const botDescReport = Strings.botDescChanged.replace({botDesc}, botDesc); const botDescReport = Strings.botDescChanged.replace('{botDesc}', botDesc);
ctx.telegram.setMyDescription(botDesc).catch(error => ctx.reply( ctx.telegram.setMyDescription(botDesc).catch(error => ctx.reply(
"Error when changing bot description:\n" + error, { "Error when changing bot description:\n" + error, {
reply_to_message_id: ctx.message.message_id reply_to_message_id: ctx.message.message_id