the guard bot, i'm trying to understand something here. This is a little snippet from routingFn.js
const [ , command, username ] =
/^\/(?:start )?(\w+)(@\w+)?/.exec(message.text);
username is always undefined even when the message content is /somecommand @foobar
even when /warn and /unwarn is used, so i was wondering whats the purpose of defining username, and how else it was working
Can you send the link to that line?
https://github.com/thedevs-network/the-guard-bot/blob/develop/handlers/commands/routingFn.js line 10,11
It's for invocations like /groups@thedevs_bot
Обсуждают сегодня