diff --git a/bot.py b/bot.py index 85b197e..df6b610 100644 --- a/bot.py +++ b/bot.py @@ -2,10 +2,15 @@ import os import importlib import nerimity +import pylast class Bot(nerimity.Client): """Extended client class for extra functionality.""" - def __init__(self, *args, **kwargs): + def __init__(self, lastfm_api_key: str, lastfm_api_secret: str, *args, **kwargs): + self.lastfm = pylast.LastFMNetwork( + api_key = lastfm_api_key, + api_secret = lastfm_api_secret + ) super().__init__(*args, **kwargs) def load_commands(self, commands_dir: str): diff --git a/main.py b/main.py index 3c20073..439b494 100644 --- a/main.py +++ b/main.py @@ -8,16 +8,12 @@ import bot with open("config.toml", "rb") as f: config = tomllib.load(f) -# last.fm client -network = pylast.LastFMNetwork( - api_key = config['api_key'], - api_secret = config['api_secret'] -) - # nerimity client bot = bot.Bot( - token=config['token'], - prefix='!' + token = config['token'], + prefix = '!', + lastfm_api_key = config['api_key'], + lastfm_api_secret = config['api_secret'] ) bot.load_commands("commands")