ref: create separated verifyUserInput function again because it was not added by git before (#44)
Co-authored-by: Aidan <aidan@p0ntus.com> Co-authored-by: Lucas Gabriel <lucmsilva651@gmail.com>
This commit is contained in:
parent
d3e467b372
commit
bdb4a4f7a2
5 changed files with 44 additions and 41 deletions
14
src/plugins/verifyInput.js
Normal file
14
src/plugins/verifyInput.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
function verifyInput(ctx, userInput, message, verifyNaN = false) {
|
||||
if (!userInput || (verifyNaN && isNaN(userInput))) {
|
||||
ctx.reply(message, {
|
||||
parse_mode: "Markdown",
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
verifyInput
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue