Changed command_prefix to use sql parameterisation

This commit is contained in:
Dusty.P 2018-04-13 23:42:34 -08:00
parent 84caaee9d5
commit 077cb36382

View File

@ -64,7 +64,7 @@ class Geeksbot(commands.Bot):
self.gcs_service = build('customsearch', 'v1', developerKey='AIzaSyAfGHj5alDWMsnVMeGUD53dI0RQij94PU4') self.gcs_service = build('customsearch', 'v1', developerKey='AIzaSyAfGHj5alDWMsnVMeGUD53dI0RQij94PU4')
async def command_prefix(self, bot, message): async def command_prefix(self, bot, message):
return self.con.one(f'select prefix from guild_config where guild_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):
bot.load_extension('{0}.{1}'.format(extension_dir,mod)) bot.load_extension('{0}.{1}'.format(extension_dir,mod))