OSDN Git Service

cannot use tables()
authoryamat0jp <yamat0jp@yahoo.co.jp>
Tue, 11 Sep 2018 10:25:07 +0000 (19:25 +0900)
committeryamat0jp <yamat0jp@yahoo.co.jp>
Tue, 11 Sep 2018 10:25:07 +0000 (19:25 +0900)
bot.py

diff --git a/bot.py b/bot.py
index 4751189..a8dfecd 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -59,7 +59,7 @@ class WebHookHandler(tornado.web.RequestHandler):
     
     def setting(self,name,dbname):
         client = pymongo.MongoClient(uri)[ac]
-        if dbname in client.tables():
+        if dbname in client.collection_names(include_system_collections=False):
             db = client['users']
             item = db.find_one({'name':name})
             if item['dbname'] == dbname: