Skip to content

Intended to be run on a schedule to update a notify a Discord channel via webhook of new ASX announcements for a specified list of companies.

License

Notifications You must be signed in to change notification settings

niallCDS/ASX-Announcements-Discord-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASX Announcements Discord Bot

❗ If you find this project helpful in any way, let me know on Twitter @niallgillmor!

Description

Lightweight discord webhook intended to be run on schedule to post webhooks to a specific Discord channel alerting new ASX announcements for a set watchlist.

Installation

  1. Download or clone the repo.
  2. pip install the dependancies/requirements listed below.
  3. Add the tickers of the companies you wish to watch to the example.config.ini file as show below.
  4. Create a webhook in the Discord channel you wish to post announcements to. Follow this guide on how to create a webhook.
  5. Using the newly created webhook URL, set the id and token in the example.config.ini file. Your ID and token are taken from the webhook URL as follows: https://discord.com/api/webhooks/id/token.
  6. Save your changes to the example.config.ini file and rename the newly saved example.config.ini file to config.ini.
  7. Run the main.py script.

NB: If you wish to schedule the script to run, I would suggest following a tutorial like this.

Dependencies/Requirements

  • requests
  • json
  • sqlite3
  • discord
  • configparser
  • datetime

To-Do

  • Clean up code.
  • Add details of installation and setup to README
  • Tool to get company's Xids, https://asx.api.markitdigital.com/asx-research/1.0/search/price?itemsPerPage=1&page=0&searchText=eml, check that symbol item is equal to code, then add it in.
  • Add config file.
  • Parse date.
  • Spice up embed.
  • Customise pfp and other elements of bot through code.
  • Add database and store unqiue.
  • Create new table if that company does not already exist.
  • Discord bot.
  • Fix dynamic embed colour.
  • Add ticker/company identify to message for stacked continuous messages.

Suggested Features

  • On first run, populate database without posting Discord messages for every past announcement.
  • Seperate announcements for different stocks into different channels.

Personal Project Learnings

  • Management of multiple Python installations on personal device and addressing installation conflicts with Homebrew.
  • python-discord-webhook module is not async, thus unsuitable for large amounts of Discord webhooks as rate limited.
  • Can utilise discord.py to send webhooks without having associated authentication with a bot.
  • Using the configparser module.
  • Formatting usable READMEs.

Contact Me

Twitter @niallgillmor

About

Intended to be run on a schedule to update a notify a Discord channel via webhook of new ASX announcements for a specified list of companies.

Topics

Resources

License

Stars

Watchers

Forks

Languages