diff --git a/.gitignore b/.gitignore index bb06846..8992d45 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ /dvenv copy.txt user_location.db - +/utils/.env diff --git a/task_bot.py b/task_bot.py index f985438..f515483 100644 --- a/task_bot.py +++ b/task_bot.py @@ -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() diff --git a/utils/__pycache__/database.cpython-313.pyc b/utils/__pycache__/database.cpython-313.pyc new file mode 100644 index 0000000..ad10040 Binary files /dev/null and b/utils/__pycache__/database.cpython-313.pyc differ diff --git a/utils/__pycache__/weather.cpython-313.pyc b/utils/__pycache__/weather.cpython-313.pyc new file mode 100644 index 0000000..f46dd28 Binary files /dev/null and b/utils/__pycache__/weather.cpython-313.pyc differ diff --git a/database.py b/utils/database.py similarity index 100% rename from database.py rename to utils/database.py diff --git a/weather.py b/utils/weather.py similarity index 85% rename from weather.py rename to utils/weather.py index 6939fb9..1279752 100644 --- a/weather.py +++ b/utils/weather.py @@ -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):