1
0
mirror of https://gitlab.com/simple-stock-bots/simple-stock-bot.git synced 2025-06-16 15:17:28 +00:00

gave regex for tickers a variable #13

This commit is contained in:
Anson 2019-03-22 12:37:43 -07:00
parent c1030d0956
commit b7fb4df4a8

View File

@ -129,7 +129,7 @@ def dividend(bot, update):
chat_id = update.message.chat_id chat_id = update.message.chat_id
try: try:
# regex to find tickers in messages, looks for up to 4 word characters following a dollar sign and captures the 4 word characters # regex to find tickers in messages, looks for up to 4 word characters following a dollar sign and captures the 4 word characters
tickers = re.findall("[$](\w{1,4})", message) tickers = re.findall(TICKER_REGEX, message)
bot.send_chat_action(chat_id=chat_id, action=telegram.ChatAction.TYPING) bot.send_chat_action(chat_id=chat_id, action=telegram.ChatAction.TYPING)
for ticker in tickers: for ticker in tickers: