|
|
|
@ -44,7 +44,7 @@ description = 'I am Geeksbot! Fear me!'
|
|
|
|
|
|
|
|
|
|
|
|
class Geeksbot(commands.Bot):
|
|
|
|
class Geeksbot(commands.Bot):
|
|
|
|
def __init__(self, **kwargs):
|
|
|
|
def __init__(self, **kwargs):
|
|
|
|
kwargs["command_prefix"] = self.get_prefix
|
|
|
|
kwargs["command_prefix"] = self.get_custom_prefix
|
|
|
|
super().__init__(**kwargs)
|
|
|
|
super().__init__(**kwargs)
|
|
|
|
self.aio_session = aiohttp.ClientSession(loop=self.loop)
|
|
|
|
self.aio_session = aiohttp.ClientSession(loop=self.loop)
|
|
|
|
with open(f'{config_dir}{bot_config_file}') as file:
|
|
|
|
with open(f'{config_dir}{bot_config_file}') as file:
|
|
|
|
@ -64,7 +64,7 @@ class Geeksbot(commands.Bot):
|
|
|
|
self.spam_list = {}
|
|
|
|
self.spam_list = {}
|
|
|
|
self.gcs_service = build('customsearch', 'v1', developerKey=self.bot_secrets['google_search_key'])
|
|
|
|
self.gcs_service = build('customsearch', 'v1', developerKey=self.bot_secrets['google_search_key'])
|
|
|
|
|
|
|
|
|
|
|
|
async def get_prefix(self, bot, message):
|
|
|
|
async def get_custom_prefix(self, bot, message):
|
|
|
|
return self.con.one(f'select prefix from guild_config where guild_id = %(id)s', {'id': message.guild.id}) or self.default_prefix
|
|
|
|
return self.con.one(f'select prefix from guild_config where guild_id = %(id)s', {'id': message.guild.id}) or self.default_prefix
|
|
|
|
|
|
|
|
|
|
|
|
async def load_ext(self, ctx, mod):
|
|
|
|
async def load_ext(self, ctx, mod):
|
|
|
|
|