import axios from "axios"
let handler = async (m, { args }) => {
if (!args[0]) throw "*Give a place to search*"
try {
const response = axios.get(`https://api.openweathermap.org/data/2.5/weather?q=${args}&units=metric&appid=060a6bcfa19809c2cd4d97a212b19273`)
const res = await response
const name = res.data.name
const Country = res.data.sys.country
const Weather = res.data.weather[0].description
const Temperature = res.data.main.temp + "Â°C"
const Minimum_Temperature = res.data.main.temp_min + "Â°C"
const Maximum_Temperature = res.data.main.temp_max + "Â°C"
const Humidity = res.data.main.humidity + "%"
const Wind = res.data.wind.speed + "km/h"
const wea = `Êœá´‡Ê€á´‡ Éªs Ê�á´�á´œÊ€ É¢Éªá´ á´‡É´ á´˜ÊŸá´€á´„á´‡ á´¡á´‡á´€á´›Êœá´‡Ê€\n\nã€Œ ğŸ“� ã€�á´˜ÊŸá´€á´„á´‡: ${name}\nã€Œ ğŸ—ºï¸� ã€�á´„á´�á´œÉ´á´›Ê€Ê�: ${Country}\nã€Œ ğŸŒ¤ï¸� ã€�á´ Éªá´‡á´¡: ${Weather}\nã€Œ ğŸŒ¡ï¸� ã€� á´›á´‡á´�á´˜á´‡Ê€á´€á´›á´œÊ€á´‡: ${Temperature}\nã€Œ ğŸ’  ã€� á´�ÉªÉ´Éªá´�á´œá´� á´›á´‡á´�á´˜á´‡Ê€á´€á´›á´œÊ€á´‡: ${Minimum_Temperature}\nã€Œ ğŸ“› ã€� á´�á´€xÉªá´�á´œá´� á´›á´‡á´�á´˜á´‡Ê€á´€á´›á´œÊ€á´‡: ${Maximum_Temperature}\nã€Œ ğŸ’¦ ã€� Êœá´œá´�Éªá´…Éªá´›Ê�: ${Humidity}\nã€Œ ğŸŒ¬ï¸� ã€�  á´¡ÉªÉ´á´…sá´˜á´‡á´‡á´…: ${Wind}\n\nğŸ›¡ï¸�á´›Êœá´‡-á´˜Ê€ÉªÉ´á´„á´‡-Ê™á´�á´›ğŸ›¡ï¸�`
m.reply(wea)
} catch {
return "*ERROR*"}}
handler.help = ['weather *<place>*']
handler.tags = ['tools']
handler.command = /^(climate|weather|mosam)$/i
export default handler
