Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, bot):
self.bot = bot
self.settings = dataIO.load_json("data/giveme/settings.json")
passed as arguments.
"""
return bot.settings.get_prefixes(message.server)
self.counter = Counter()
self.uptime = datetime.datetime.utcnow() # Refreshed before login
self._message_modifiers = []
self.settings = Settings()
self._intro_displayed = False
self._shutdown_mode = None
self.logger = set_logger(self)
self._last_exception = None
self.oauth_url = ""
try:
self._cog_registry = dataIO.load_json("data/red/cogs.json")
except Exception:
self._cog_registry = {}
if 'self_bot' in kwargs:
self.settings.self_bot = kwargs['self_bot']
else:
kwargs['self_bot'] = self.settings.self_bot
if self.settings.self_bot:
kwargs['pm_help'] = False
super().__init__(*args, command_prefix=prefix_manager, **kwargs)
def _import_old_data(data):
"""Migration from mod.py"""
try:
data["blacklist"] = dataIO.load_json("data/mod/blacklist.json")
except FileNotFoundError:
pass
try:
data["whitelist"] = dataIO.load_json("data/mod/whitelist.json")
except FileNotFoundError:
pass
return data
def __init__(self, bot):
self.bot = bot
self.settings = dataIO.load_json("data/giveaways/settings.json")
self.started = False
def _load_playlist(self, server, name, local=True):
try:
server = server.id
except:
pass
f = "data/audio/playlists"
if local:
f = os.path.join(f, server, name + ".txt")
else:
f = os.path.join(f, name + ".txt")
kwargs = dataIO.load_json(f)
kwargs['path'] = f
kwargs['main_class'] = self
kwargs['name'] = name
kwargs['sid'] = server
kwargs['server'] = self.bot.get_server(server)
return Playlist(**kwargs)
def __init__(self, bot):
self.bot = bot
self.settings = dataIO.load_json("data/warner/warnings.json")
def get_info_data(self, repo_name, cog=None):
if cog is not None:
cogs = self.list_cogs(repo_name)
if cog in cogs:
info_file = os.path.join(cogs[cog].get('folder'), "info.json")
if os.path.isfile(info_file):
try:
data = dataIO.load_json(info_file)
except:
return None
return data
else:
repo_info = os.path.join(self.path, repo_name, 'info.json')
if os.path.isfile(repo_info):
try:
data = dataIO.load_json(repo_info)
return data
except:
return None
return None
def __init__(self, bot):
self.bot = bot
self.settings = dataIO.load_json(SETTINGS)
if self.settings["api_key"] == "":
print("Cog error: imdb, No API key found, please configure me!")
def __init__(self, bot):
self.bot = bot
self.key = dataIO.load_json("data/wot/key.json")['key']
self.servers = {'eu': 'eu', 'ru': 'ru', 'asia': 'asia', 'na': 'com', 'kr': 'kr'}