organize
This commit is contained in:
parent
cd5b65b3cc
commit
c5de68d6b1
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,4 +4,4 @@
|
|||||||
/dvenv
|
/dvenv
|
||||||
copy.txt
|
copy.txt
|
||||||
user_location.db
|
user_location.db
|
||||||
|
/utils/.env
|
||||||
|
|||||||
@ -2,12 +2,12 @@ import os
|
|||||||
import discord
|
import discord
|
||||||
import datetime
|
import datetime
|
||||||
from google_auth_oauthlib.flow import InstalledAppFlow
|
from google_auth_oauthlib.flow import InstalledAppFlow
|
||||||
from weather import OpenWeatherMapAPIClient
|
from utils.weather import OpenWeatherMapAPIClient
|
||||||
from googleapiclient.discovery import build
|
from googleapiclient.discovery import build
|
||||||
from google.oauth2.credentials import Credentials
|
from google.oauth2.credentials import Credentials
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from database import UserLocation
|
from utils.database import UserLocation
|
||||||
from asyncio import to_thread
|
from asyncio import to_thread
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|||||||
BIN
utils/__pycache__/database.cpython-313.pyc
Normal file
BIN
utils/__pycache__/database.cpython-313.pyc
Normal file
Binary file not shown.
BIN
utils/__pycache__/weather.cpython-313.pyc
Normal file
BIN
utils/__pycache__/weather.cpython-313.pyc
Normal file
Binary file not shown.
@ -1,10 +1,15 @@
|
|||||||
import requests
|
import requests
|
||||||
|
import os
|
||||||
from geopy.geocoders import Nominatim
|
from geopy.geocoders import Nominatim
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
load_dotenv()
|
||||||
|
WEATHER_TOKEN = os.getenv("WEATHER_TOKEN")
|
||||||
|
|
||||||
class OpenWeatherMapAPIClient:
|
class OpenWeatherMapAPIClient:
|
||||||
def __init__(self, api_token, name):
|
def __init__(self, api_token, name):
|
||||||
self.base_url = "https://api.openweathermap.org"
|
self.base_url = "https://api.openweathermap.org"
|
||||||
self._api_token = "c6ee0c7c013f6d4bc9dc20982aecb6ec"
|
self._api_token = WEATHER_TOKEN
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
def get_geodata(self, location):
|
def get_geodata(self, location):
|
||||||
Loading…
x
Reference in New Issue
Block a user