Send poll
You can send poll to the channel or to the user
Send poll
Poll class take arguments
Argument
Description
Required
1
2
3
import { Controller, MessageSend, OnCommand, Poll } from 'nestgram';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@OnCommand('start')
sendPoll(): MessageSend {
return new MessageSend(
new Poll(
'What is Nestgram?', // question
['Framework', 'Library'], // options
{ // params
type: 'quiz', // send quiz
is_anonymous: true, // send anonymous quiz
correct_option_id: 0, // and correct answer is 'Framework'
}
),
);
}
}Stop poll
StopPoll class-method take arguments:
Argument
Description
Required
1
2
3
4
Last updated