Skip to content

how to create command with parameter #1771

Answered by hypernova7
ngdream asked this question in Q&A
Discussion options

You must be logged in to vote
bot.command('add', ctx => {
  const [cmd, param] = (ctx.message.reply_to_message || ctx.message).text.split(' ')
  console.log(cmd, param)
  if (!param) return ctx.reply('Missing param');
  doSomething()
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ngdream
Comment options

Answer selected by ngdream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants