hf: use global regex instead

This commit is contained in:
Aidan 2025-04-14 19:37:43 -04:00
parent b619892c1c
commit 935385eb4f
3 changed files with 12 additions and 12 deletions

View file

@ -6,8 +6,8 @@ async function sendHelpMessage(ctx, isEditing) {
const Strings = getStrings(ctx.from.language_code);
const botInfo = await ctx.telegram.getMe();
const helpText = Strings.botHelp
.replace('{botName}', botInfo.first_name)
.replace("{sourceLink}", process.env.botSource);
.replace(/{botName}/g, botInfo.first_name)
.replace(/{sourceLink}/g, process.env.botSource);
const options = {
parse_mode: 'Markdown',
disable_web_page_preview: true,
@ -35,7 +35,7 @@ module.exports = (bot) => {
bot.command("about", spamwatchMiddleware, async (ctx) => {
const Strings = getStrings(ctx.from.language_code);
const aboutMsg = Strings.botAbout.replace("{sourceLink}", `${process.env.botSource}`);
const aboutMsg = Strings.botAbout.replace(/{sourceLink}/g, `${process.env.botSource}`);
ctx.reply(aboutMsg, {
parse_mode: 'Markdown',