Repair load_module, and smshandler

This commit is contained in:
louis chauvet 2018-08-20 18:27:52 +02:00
parent ed49ab9eb1
commit e2976f9e8a
4 changed files with 6 additions and 4 deletions

View File

@ -7,6 +7,9 @@ import os
class SMSHandler(logging.Handler):
def emit(self, record):
msg = urllib.parse.quote(self.format(record).encode('utf8'))
urllib.request.urlopen("https://smsapi.free-mobile.fr/sendmsg?user=" +
try:
urllib.request.urlopen("https://smsapi.free-mobile.fr/sendmsg?user=" +
os.environ.get("FREE_SMS_USER", "") + "&pass=" +
os.environ.get("FREE_SMS_PASS", "") + "&msg=" + msg)
except urllib.error.HTTPError:
pass

View File

@ -1,2 +0,0 @@
user = ""
password = ""

View File

@ -132,7 +132,7 @@ class FoBot(discord.Client):
def load_modules(self):
for module in os.listdir('modules'):
if module != "__pycache__":
if module != "__pycache__" and module.endswith(".py"):
imported = importlib.import_module('modules.' + module[:-3])
self.modules.update({module[:-3]: imported.MainClass})

View File

@ -10,3 +10,4 @@ pycparser==2.18
six==1.11.0
websockets==6.0
yarl==1.2.6
fs