Use environement variables for tokens

This commit is contained in:
louis chauvet 2018-08-20 11:53:14 +02:00
parent 29b80d761b
commit ed49ab9eb1
3 changed files with 7 additions and 4 deletions

View File

@ -1,9 +1,12 @@
import logging
import urllib
import config_sms
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=" + config_sms.user + "&pass=" + config_sms.password + "&msg=" + msg)
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)

View File

@ -199,4 +199,4 @@ class FoBot(discord.Client):
myBot = FoBot()
myBot.run("", max_messages=100000000)
myBot.run(os.environ.get("DISCORD_TOKEN", ""), max_messages=100000000)

View File

@ -3,7 +3,7 @@ async-timeout==3.0.0
attrs==18.1.0
cffi==1.11.5
chardet==3.0.4
git+https://github.com/Rapptz/discord.py@rewrite#egg=package-two
git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py
idna==2.7
multidict==4.3.1
pycparser==2.18