Repair load_module, and smshandler
This commit is contained in:
parent
ed49ab9eb1
commit
e2976f9e8a
@ -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
|
||||
|
@ -1,2 +0,0 @@
|
||||
user = ""
|
||||
password = ""
|
2
main.py
2
main.py
@ -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})
|
||||
|
||||
|
@ -10,3 +10,4 @@ pycparser==2.18
|
||||
six==1.11.0
|
||||
websockets==6.0
|
||||
yarl==1.2.6
|
||||
fs
|
Loading…
Reference in New Issue
Block a user