Revert "ref: create separated verifyUserInput function (#34)" (#42)

This reverts commit 12ca87f4fe.
This commit is contained in:
Lucas Gabriel 2025-04-19 23:52:51 -03:00 committed by GitHub
parent 3d125ffbf9
commit 8aaa60e78d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 39 additions and 28 deletions

View file

@ -7,7 +7,6 @@ const axios = require('axios');
const { getStrings } = require('../plugins/checklang.js');
const { isOnSpamWatch } = require('../spamwatch/spamwatch.js');
const spamwatchMiddleware = require('../spamwatch/Middleware.js')(isOnSpamWatch);
const { verifyInput } = require('../plugins/verifyInput.js');
const statusEmojis = {
0: '⛈', 1: '⛈', 2: '⛈', 3: '⛈', 4: '⛈', 5: '🌨', 6: '🌨', 7: '🌨',
@ -36,10 +35,12 @@ module.exports = (bot) => {
const userLang = ctx.from.language_code || "en-US";
const Strings = getStrings(userLang);
const userInput = ctx.message.text.split(' ').slice(1).join(' ');
const { provideLocation } = Strings.weatherStatus
if (verifyInput(ctx, userInput, provideLocation)) {
return;
if (!userInput) {
return ctx.reply(Strings.weatherStatus.provideLocation, {
parse_mode: "Markdown",
reply_to_message_id: ctx.message.message_id
});
}
const location = userInput;
@ -94,7 +95,7 @@ module.exports = (bot) => {
.replace('{windSpeed}', windSpeed)
.replace('{speedUnit}', speedUnit);
ctx.reply(weatherMessage, {
ctx.reply(weatherMessage, {
parse_mode: "Markdown",
reply_to_message_id: ctx.message.message_id
});