Skip to content

Commit

Permalink
Regex to Match Strings Starting with /
Browse files Browse the repository at this point in the history
  • Loading branch information
chisa-dev committed Jan 26, 2025
1 parent 05861f1 commit 3efa8c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ bot.on('inline_query', (query) => handleInlineContent(bot, query));
bot.on('message', async (msg) => {


if (!msg.photo && msg.text.startsWith('/')) {
if (!msg.photo && /^\/.*/.test(msg.text)) {
return;
}

Expand Down Expand Up @@ -249,6 +249,7 @@ bot.on('message', async (msg) => {

// Send the video file to the user
await bot.sendVideo(chatId, videoStream, {
caption: `🎥 @horansoftware `,
parse_mode: "Markdown",
});

Expand Down

0 comments on commit 3efa8c8

Please sign in to comment.