Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { deunionize } from 'telegraf';
- import { Context } from '../interfaces';
- export const getCommandArgs = (ctx: Context): string => {
- const messageText = deunionize(ctx.message).text;
- const argsFromCommandRegex = /\/(?:\w+)(?:@.*_bot)? (?<args>.*)/;
- const args = argsFromCommandRegex.exec(messageText);
- return args.groups.args.trim();
- };
Add Comment
Please, Sign In to add comment