added weather base

This commit is contained in:
Tenzing Kandang 2026-03-11 17:07:25 +01:00
parent f69271e14c
commit eeed5b8e03
2 changed files with 4 additions and 3 deletions

1
README.md Normal file
View File

@ -0,0 +1 @@
Dask Bot

View File

@ -3,7 +3,7 @@ import discord
from discord.ext import commands
from weather import OpenWeatherMapAPIClient
DISCORD_TOKEN = os.getenv('MTQ4MDkxODI5Mzk5MTc4ODYzNQ.GQ4P7l.uqYM-awr8zAp6eun9iJr0ziDhscv3XiByqSMpw')
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN")
WEATHER_TOKEN = os.getenv("WEATHER_TOKEN")
weather_client = OpenWeatherMapAPIClient(WEATHER_TOKEN, "MyDiscordWeatherBot")
@ -37,7 +37,7 @@ async def current_weather(interaction: discord.Interaction, location: str):
icon = current_weather['weather'][0]['icon']
embed = discord.Embed(
title=f"Current weather in {location}",
description=f"Temperature: {temp}°C\n Sky: {weather_condition}",
description=f"Temperature: {temp}°C\nSky: {weather_condition}",
)
embed.set_thumbnail(url=f"https://openweathermap.org/img/wn/{icon}.png")