Fixed db_con

release-1.0.0
DustyP 8 years ago
parent 005f4ca25d
commit 9f552d76eb

@ -57,16 +57,19 @@ class Geeksbot(commands.Bot):
self.infected = {}
self.TOKEN = self.bot_secrets['token']
del self.bot_secrets['token']
self.db_con = asyncpg.connect(f"host={self.bot_secrets['db_con']['host']}\
database={self.bot_secrets['db_con']['db_name']}\
user={self.bot_secrets['db_con']['user']}\
password={self.bot_secrets['db_con']['password']}")
self.db_con = self.connect_db(self)
del self.bot_secrets['db_con']
self.default_prefix = 'g~'
self.voice_chans = {}
self.spam_list = {}
self.gcs_service = build('customsearch', 'v1', developerKey=self.bot_secrets['google_search_key'])
async def connect_db(self):
return await asyncpg.connect(f"host={self.bot_secrets['db_con']['host']}\
database={self.bot_secrets['db_con']['db_name']}\
user={self.bot_secrets['db_con']['user']}\
password={self.bot_secrets['db_con']['password']}")
@staticmethod
async def get_custom_prefix(bot_inst, message):
return await bot_inst.db_con.fetchval('select prefix from guild_config where guild_id = $1',

@ -1,6 +1,6 @@
#!/bin/bash
until python /home/dusty/bin/geeksbot/geeksbot.py; do
until python /home/dusty/bin/geeksbot_dev/geeksbot.py; do
echo "Geeksbot shutdown with error: $?. Restarting..." >&2
sleep 1
done

Loading…
Cancel
Save