Skip to content

Commit

Permalink
Info command and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
aaditya2200 committed Aug 5, 2021
1 parent 66ea291 commit 4e11509
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
9 changes: 8 additions & 1 deletion core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,11 @@
V1_DATA_STR = 'Issuer Company: {}\nExchange: {}\nOpen: {}\nClose: {}\nLot Size: {}\nIssue Price (Rs): {}\nIssue Price (' \
'Rs. Cr.): {}'
BROKER_URL = 'redis://127.0.0.1:6379/0'
PAYMENTS_LINK = 'https://rzp.io/i/GPZBQoopbn'
PAYMENTS_LINK = 'https://rzp.io/i/GPZBQoopbn'
INFO_MESSAGE = 'This bot was created with the purpose of providing reliable information about IPOs. '
CREATORS_LINK_1 = 'Created by Aaditya Rangarajan: {}'.format(
'https://almondine-tamarillo-1ce.notion.site/Hey-there-7d1f73288db34da6a18d84587096a216',
)
CREATORS_LINK_2 = 'In collaboration with Amol Soans: {}'.format(
'https://wonderful-lewin-6295dc.netlify.app/'
)
11 changes: 9 additions & 2 deletions tasks/fetch_ipo_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
import json

from core.constants import GREET_MESSAGE, REDIS_HASHES, DATA_STR, V1_DATA_STR, PAYMENTS_LINK
from core.constants import GREET_MESSAGE, REDIS_HASHES, DATA_STR, V1_DATA_STR, PAYMENTS_LINK, INFO_MESSAGE, CREATORS_LINK_1, CREATORS_LINK_2
from redis_conf import RedisConf
from scrapers.mybot import MyBot

Expand All @@ -19,7 +19,8 @@ def fetch_ipo_details():
'documents related to that IPO. \n',
'/donate': 'Donate 100 rupees if you like this service, it aids in paying for cloud services.\n',
'/contribute': 'Contribute to this project!\n',
'/contact': 'Contact information for feedback and queries.\n'
'/contact': 'Contact information for feedback and queries.\n',
'/info': 'About the creators.'
}

# start the bot
Expand Down Expand Up @@ -217,6 +218,12 @@ def list_all(message):
)
bot.send_message(message.chat.id, data_str)

@bot.message_handler(commands=['info'])
def info(message):
bot.send_message(message.chat.id, INFO_MESSAGE)
bot.send_message(message.chat.id, CREATORS_LINK_1)
bot.send_message(message.chat.id, CREATORS_LINK_2)


print('👂 Listening for messages')
bot.polling()
Expand Down

0 comments on commit 4e11509

Please sign in to comment.