1
0
mirror of https://gitlab.com/simple-stock-bots/simple-stock-bot.git synced 2025-06-15 14:56:40 +00:00
2021-03-11 14:27:06 -07:00
2021-01-24 11:43:35 -07:00
2021-02-11 16:00:49 -07:00
2021-01-31 16:52:05 -07:00
2021-03-11 14:27:06 -07:00
2019-02-20 07:02:29 +00:00
2021-01-31 17:59:47 -07:00

Simple Telegram Stock Bot

Simple Telegram Stock Bot

Buy Me A Beer

Status Platform License


Telegram Bot 🤖 that provides Stock Market information.

Message the bot on Telegram @SimpleStockBot

📝 Table of Contents

🧐 About

This bot aims to be as simple as possible while providing all the information you need on the stock market. The motivation of this bot is to provide similar stock market functionality that the Google Assistant provided in Google Allo before the project was sunset.

💭 How it works

This bot works by using the IEX API 2.0. Using various endpoints provided by the API, the bot can take either take commands from users or check any messages for stock symbols as detailed in Usage.

🎈 Usage

Basic Usage

The simplest way to use the bot is just by sending a message either as a direct message or in a group chat with the bot active. The bot will search every message for text with a dollar sign followed by a stock symbol, and it will return the full name of the company and the current trading price.

$tsla

The symbols can be anywhere in the message, and you can post as many as you like so commands such as:

I wonder if $aapl is down as much as $msft is today.

would return the stock price of both Apple and Microsoft like so:

The current stock price of Microsoft Corp. is $131.4, the stock is currently up 2.8%

The current stock price of Apple, Inc. is $190.15, the stock is currently up 2.66%

/dividend

To get information about the dividend of a stock type /dividend followed by any text that has symbols with a dollar sign in front of them. So, the following command:

/dividend $psec

Would return information about Prospect Capitals dividend:

Prospect Capital Corp. Declares June 2019 Dividend of $0.06 Per Share
The dividend is in: 38 Days 3 Hours 53 Minutes 22 Seconds.

💡 you can also call the dividend command using /div

/news

To get the latest news about a stock symbol use /news followed by any text that has symbols with a dollar sign in front of them. So, the following command:

/news $psec

Would return news for Prospect Capital:

News for PSEC:

Yield-Starved Investors Still Accumulating BDCs Paying More Than 10% Annually

Assessing Main Street Capital's Results For Q1 2019 (Includes Updated Price Target And Investment Ratings Analysis)

Fully Assessing Prospect Capital's Fiscal Q3 2019 (Includes Current Recommendation And Price Target)

/info

To get information about a stock type /info followed by any text that has symbols with a dollar sign in front of them. So, the following command:

/info $psec

Would return information about Prospect Capitals:

Company Name: Prospect Capital Corp.
Industry: Investment Managers
Sector: Finance
CEO: John Francis Barry
Description: Prospect Capital Corp. is a business development company, which engages in lending to and investing in private businesses. It also involves in generating current income and long-term capital appreciation through debt and equity investments. The company was founded on April 13, 2004 and is headquartered in New York, NY.

🏁 Getting Started

You can either choose to use the hosted version of the bot by clicking here or you can host your own bot with the instructions below.

Self Hosted Bot

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

This project runs neatly in a docker container, so all that you need to run it yourself is Docker installed on your system.

You will also need a telegram API key which can be obtained for free by talking to BotFather, more details here.

Finally, you will need and IEX Cloud API key. They offer a free tier that should be enough for any private groups, more details here.

Installing

Once Docker is installed and you have your API keys for Telegram and IEX Cloud getting the bot running on any platform is extremely easy.

Download or clone the repository to your machine and open a terminal in the project and build the Docker container.

docker build -t simple-telegram-bot .

Then run the bot using your API keys.

docker run --detach \
     -e TELEGRAM=TELEGRAM_API \
     -e IEX=IEX_API \
      simple-telegram-bot

Your bot should be running! If you are new to Docker, I would recommend checking out its documentation for full control over your bot.

🚀 Deploying your own bot

I recommend Digital Ocean for small projects like this because it is straightforward to use and affordable. Sign up with my referral code, and we both get some free hosting.

⛏️ Built Using

✍️ author

🎉 Acknowledgements

  • Telegram for having a great bot API
  • IEX Cloud for offering a free tier
  • Viewers like you ♥
Description
No description provided
Readme MIT 3.5 MiB
Languages
Python 97.3%
CSS 1.2%
Dockerfile 1%
HTML 0.5%