Cleaned initial printing
This commit is contained in:
parent
8ed5ca870a
commit
9993023c7e
1 changed files with 4 additions and 6 deletions
10
bot.py
10
bot.py
|
@ -16,13 +16,11 @@ class Bot(commands.Bot):
|
||||||
self.db_cur = self.db_con.cursor()
|
self.db_cur = self.db_con.cursor()
|
||||||
|
|
||||||
if self.db_cur.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='custom_commands'").fetchone() == None:
|
if self.db_cur.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='custom_commands'").fetchone() == None:
|
||||||
print("Created database table")
|
|
||||||
self.db_cur.execute("CREATE TABLE custom_commands(command, output_text)")
|
self.db_cur.execute("CREATE TABLE custom_commands(command, output_text)")
|
||||||
|
print("Created database table")
|
||||||
commands = self.db_cur.execute("SELECT * FROM custom_commands").fetchall()
|
else:
|
||||||
if len(commands) > 0:
|
commands = self.db_cur.execute("SELECT * FROM custom_commands").fetchall()
|
||||||
print("Loaded custom commands:")
|
print(f"{len(commands)} custom commands available")
|
||||||
print(commands)
|
|
||||||
|
|
||||||
async def event_ready(self):
|
async def event_ready(self):
|
||||||
print(f"Logged in as | {self.nick}")
|
print(f"Logged in as | {self.nick}")
|
||||||
|
|
Loading…
Add table
Reference in a new issue