Hey, do you want to set a global keyboard? Something like this would do:
constkb=newKeyboard().keys(['Hey','Test']);constglobalMessage=newMessage().keyboard(kb);bot.get(/Hello/,message=>{bot.send(globalMessage.msg('Hey'));});bot.get(/Test/,message=>{bot.send(globalMessage.msg('This is a test'));});
So you define a message with your global keyboard and for each response, you only change the message/other properties. If you don't like this approach, you can make something yourself like:
functionmsg(){returnnewMessage().keyboard(kb);}
So now instead of creating messages using new Message, you use msg() which always sets your global keyboard, the second appraoch is more reliable, so I recommend it.
Hey, do you want to set a global keyboard? Something like this would do:
``` javascript
const kb = new Keyboard().keys(['Hey', 'Test']);
const globalMessage = new Message().keyboard(kb);
bot.get(/Hello/, message => {
bot.send(globalMessage.msg('Hey'));
});
bot.get(/Test/, message => {
bot.send(globalMessage.msg('This is a test'));
});
```
So you define a message with your global keyboard and for each response, you only change the message/other properties. If you don't like this approach, you can make something yourself like:
``` javascript
function msg() {
return new Message().keyboard(kb);
}
```
So now instead of creating messages using `new Message`, you use `msg()` which always sets your global keyboard, the second appraoch is more reliable, so I recommend it.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
how to set a custom keyboard with this package?
we must define keyboard on every message that i recieve?
Hey, do you want to set a global keyboard? Something like this would do:
So you define a message with your global keyboard and for each response, you only change the message/other properties. If you don't like this approach, you can make something yourself like:
So now instead of creating messages using
new Message, you usemsg()which always sets your global keyboard, the second appraoch is more reliable, so I recommend it.agha dame shoma garm,hal dadi.packagetam alie!tabrik migam be tavanaiiiit
@Behnamgh: Khoshhalam be karet oomad 😁, mamnoon ✌️