|
@@ -281,12 +281,14 @@ async def here_cmd(author, server, channel):
|
|
|
|
|
|
|
|
await channel.send("Channel updated to: **{}**.".format(channel))
|
|
await channel.send("Channel updated to: **{}**.".format(channel))
|
|
|
|
|
|
|
|
- cursor.close()
|
|
|
|
|
|
|
+ cursor.close()
|
|
|
else:
|
|
else:
|
|
|
# No server found in DB, so register it
|
|
# No server found in DB, so register it
|
|
|
cursor = globals.conn.cursor(buffered=True)
|
|
cursor = globals.conn.cursor(buffered=True)
|
|
|
cursor.execute("INSERT INTO t_servers (server, channel) VALUES ({},{})".format(server.id, channel.id))
|
|
cursor.execute("INSERT INTO t_servers (server, channel) VALUES ({},{})".format(server.id, channel.id))
|
|
|
globals.conn.commit() # TODO Move to corresponding file
|
|
globals.conn.commit() # TODO Move to corresponding file
|
|
|
|
|
+
|
|
|
|
|
+ cursor.close()
|
|
|
|
|
|
|
|
await channel.send("Channel **{}** configured for **{}**.".format(channel, server))
|
|
await channel.send("Channel **{}** configured for **{}**.".format(channel, server))
|
|
|
|
|
|
|
@@ -390,6 +392,7 @@ async def top_cmd(words, channel):
|
|
|
try:
|
|
try:
|
|
|
cursor = globals.conn.cursor(buffered=True)
|
|
cursor = globals.conn.cursor(buffered=True)
|
|
|
cursor.callproc('sp_UsersPerKeyword', [str(keyword), '20'])
|
|
cursor.callproc('sp_UsersPerKeyword', [str(keyword), '20'])
|
|
|
|
|
+
|
|
|
for result in cursor.stored_results():
|
|
for result in cursor.stored_results():
|
|
|
data = result.fetchone()
|
|
data = result.fetchone()
|
|
|
|
|
|