added weather base
This commit is contained in:
parent
f69271e14c
commit
eeed5b8e03
@ -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")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user