Replies: 2 comments 1 reply
-
Just use this: // Input: /register HR John Doe
// Handler:
$bot->onCommand('register (\w+) (.*)', function (Nutgram $bot, $role, $name) {
// $role is "HR"
// $name is "John Doe"
}); |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, i want to accept the following command
/register [DEPARTMENT] [FULLNAME]
$bot->onCommand('register {parameter} {parameter2}', function (Nutgram $bot, $parameter,$parameter2) {
example
/register HR full name here.
but if my 2nd parameter has a spacing, it wouldnt work.
/register HR john (works)
/register HR john doe (does not work)
Beta Was this translation helpful? Give feedback.
All reactions