import { deunionize } from 'telegraf'; import { Context } from '../interfaces'; export const getCommandArgs = (ctx: Context): string => { const messageText = deunionize(ctx.message).text; const argsFromCommandRegex = /\/(?:\w+)(?:@\w+?_bot)? (?.*)/i; const args = argsFromCommandRegex.exec(messageText); if (!args) { return ''; } return args.groups.args.trim(); };