Skip to content

Commit

Permalink
Moved telegram settings to user.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
thiazzz committed Feb 11, 2021
1 parent efcfed1 commit 37df6cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .user.cfg.exmaple
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
api_key=vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A
api_secret_key=NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j
current_coin=ETC
botChatID=xxx
botToken=yyy
13 changes: 7 additions & 6 deletions crypto_trading.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
import configparser
import telegram

# Telegram bot
botChatID = 'xxx'
botToken = 'yyy'
bot = telegram.Bot(token=botToken)

# Config consts
CFG_FL_NAME = 'user.cfg'
USER_CFG_SECTION = 'binance_user_config'
Expand All @@ -29,7 +24,6 @@
logger.addHandler(fh)

logger.info('Started')
bot.sendMessage(chat_id=botChatID, text='Started')

# Add supported coin symbols here
supported_coin_list = [u'XLM', u'TRX', u'LTC', u'LINK', u'DOT', u'GRT', u'ICX', u'EOS', u'IOTA', u'ONT',u'QTUM', u'ETC', u'ADA', u'XMR', u'DASH', u'NEO', u'ATOM', u'DOGE', u'VET', u'BAT', u'OMG', u'BTT']
Expand All @@ -41,6 +35,13 @@
exit()
config.read(CFG_FL_NAME)

# Telegram bot
botChatID = config.get(USER_CFG_SECTION, 'botChatID')
botToken = config.get(USER_CFG_SECTION, 'botToken')
bot = telegram.Bot(token=botToken)
bot.sendMessage(chat_id=botChatID, text='Started')


class CryptoState():
_coin_backup_file = ".current_coin"
_table_backup_file = ".current_coin_table"
Expand Down

0 comments on commit 37df6cd

Please sign in to comment.