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
|
@ -3,6 +3,7 @@ const { getStrings } = require('../plugins/checklang.js');
|
|||
const { isOnSpamWatch } = require('../spamwatch/spamwatch.js');
|
||||
const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch);
|
||||
const axios = require('axios');
|
||||
const { verifyInput } = require('../plugins/verifyInput.js');
|
||||
|
||||
async function getDeviceList() {
|
||||
try {
|
||||
|
@ -23,12 +24,10 @@ module.exports = (bot) => {
|
|||
bot.command(['codename', 'whatis'], spamwatchMiddleware, async (ctx) => {
|
||||
const userInput = ctx.message.text.split(" ").slice(1).join(" ");
|
||||
const Strings = getStrings(ctx.from.language_code);
|
||||
|
||||
if (!userInput) {
|
||||
ctx.reply(Strings.codenameCheck.noCodename, {
|
||||
parse_mode: "Markdown",
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
});
|
||||
const { noCodename } = Strings.codenameCheck
|
||||
|
||||
if(verifyInput(ctx, userInput, noCodename)){
|
||||
return;
|
||||
}
|
||||
|
||||
const jsonRes = await getDeviceList()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue