This commit is contained in:
Tenzing Kandang 2026-03-30 16:10:15 +02:00
parent cd5b65b3cc
commit c5de68d6b1
6 changed files with 9 additions and 4 deletions

2
.gitignore vendored
View File

@ -4,4 +4,4 @@
/dvenv
copy.txt
user_location.db
/utils/.env

View File

@ -2,12 +2,12 @@ import os
import discord
import datetime
from google_auth_oauthlib.flow import InstalledAppFlow
from weather import OpenWeatherMapAPIClient
from utils.weather import OpenWeatherMapAPIClient
from googleapiclient.discovery import build
from google.oauth2.credentials import Credentials
from discord.ext import commands
from dotenv import load_dotenv
from database import UserLocation
from utils.database import UserLocation
from asyncio import to_thread
load_dotenv()

Binary file not shown.

Binary file not shown.

View File

@ -1,10 +1,15 @@
import requests
import os
from geopy.geocoders import Nominatim
from dotenv import load_dotenv
load_dotenv()
WEATHER_TOKEN = os.getenv("WEATHER_TOKEN")
class OpenWeatherMapAPIClient:
def __init__(self, api_token, name):
self.base_url = "https://api.openweathermap.org"
self._api_token = "c6ee0c7c013f6d4bc9dc20982aecb6ec"
self._api_token = WEATHER_TOKEN
self.name = name
def get_geodata(self, location):