mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
fix: show weather for cities that contains space in the name
This commit is contained in:
parent
30a24ff36f
commit
368e54594b
@ -36,16 +36,16 @@ module.exports = (bot) => {
|
||||
bot.command(['clima', 'weather'], spamwatchMiddleware, async (ctx) => {
|
||||
const userLang = ctx.from.language_code || "en-US";
|
||||
const Strings = getStrings(userLang);
|
||||
const args = ctx.message.text.split(' ');
|
||||
const args = ctx.message.text;
|
||||
|
||||
if (args.length !== 2) {
|
||||
if (args.length < 9) {
|
||||
return ctx.reply(Strings.provideLocation, {
|
||||
parse_mode: "Markdown",
|
||||
reply_to_message_id: ctx.message.message_id
|
||||
});
|
||||
}
|
||||
|
||||
const location = args[1];
|
||||
const location = args.slice(9);
|
||||
const apiKey = Config.weatherKey;
|
||||
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user