πŸ“ˆ A Discord bot for displaying the download stats of a repository made with Python, the Hikari API and PostgreSQL.

Overview

πŸ“ˆ axyl-stats

axyl-stats is a Discord bot made with Python (with the Hikari API wrapper) and PostgreSQL, used as a download counter for a GitHub repo.

This bot is used to check the download stats of a particular repo either with a bot command (.stats) or automatically in a set interval (TODO).

Setting up this bot is done through the .env environment variables.

Python Postgres Discord

Contents

Overview

Right now, the bot's functionality is like this:

axyl-stats image

Setting Up

Python 3.8 and above is required. PostgreSQL must also be installed, set up with a database and running. axyl-stats will take care of creating and managing the database table.

First, clone this repo:

git clone https://github.com/angelofallars/axyl-stats

Then, change directories into the repo and install the required dependencies:

cd axyl-stats
python3 -m pip install -r requirements.txt

In the same directory, make a .env file and put the bot token and repo info in there.

The environment variables that axyl-stats will use are:

axyl-stats.py

Required

  • BOT_TOKEN: The Discord bot's API token. Make a new Discord application in the Discord Dev Portal and create a bot for it. You will see the copyable token.
  • REPO_OWNER: The owner of the repo.
  • REPO_NAME: The name of the repo.
  • DB_NAME: The database to fetch data from.
    • You must create a database in PostgreSQL first with the name DB_NAME before you can run this app.
  • COUNTER_CHANNEL: The Discord channel(s) to send automated statistics to. Multiple channels are separated with a comma (,).

Optional

  • INTERVAL (default 60): The interval in minutes in which the bot will fetch the download stats.
  • DB_USER: The user logging into the DB.
  • DB_PASS: The DB password.
  • DB_HOST (default 127.0.0.1): The host IP address.
  • DB_PORT (default 5432): The port of the DB.

stats-database.py

To run the database testing, you must also put in the .env file:

Required

  • DB_NAME: Ditto.
  • REPO_OWNER: Ditto.
  • REPO_NAME: Ditto.

Optional

  • GITHUB_API_KEY: The GitHub API key for requesting data. If you don't have an API key, you'll be limited to 60 requests per hour.
  • DB_USER: Ditto.
  • DB_PASS: Ditto.
  • DB_HOST: Ditto.
  • DB_PORT: Ditto.
  • DB_UPDATE_INTERVAL (default 5): The interval (in minutes) to update the database.

.env example

.env file

BOT_TOKEN=<your token>
GITHUB_API_KEY=<api key>
REPO_OWNER=axyl-os
REPO_NAME=axyl-iso
INTERVAL=60
COUNTER_CHANNEL=axyl-statistics
DB_NAME=axyl-stats
DB_USER=archie
DB_PASS=hunter2

Running The Bot

To run the bot:

python3 axyl_stats.py

To run the backend that updates the database with info from the GitHub API:

python3 stats_database.py

Testing

To be able to unit test the bot, you must also specify a TEST_BOT_TOKEN in the .env file. (Tests not yet implemented)

License

This program is licensed under the GPLv3 License.

Owner
Angelo-F
Dev @axyl-os
Angelo-F
streamlit translator is used to detect and translate between languages created using gTTS, googletrans, pillow and streamlit python packages

Streamlit Translator Streamlit Translator is a simple translator app to detect and translate between languages. Streamlit Translator gets text and lan

Siva Prakash 5 Apr 05, 2022
A Telegram bot that searches for the original source of anime, manga, and art

A Telegram bot that searches for the original source of anime, manga, and art How to use the bot Just send a screenshot of the anime, manga or art or

Kira Kormak 9 Dec 28, 2022
Telegram bot for searching videos in your PDisk account by @AbirHasan2005

PDisk-Videos-Search A Telegram bot for searching videos in your PDisk account by @AbirHasan2005. Configs API_ID - Get from @TeleORG_Bot API_HASH - Get

Abir Hasan 39 Oct 21, 2022
Unofficial Python API client for Notion.so

notion-py Unofficial Python 3 client for Notion.so API v3. Object-oriented interface (mapping database tables to Python classes/attributes) Automatic

Jamie Alexandre 3.9k Jan 03, 2023
Python JIRA Library is the easiest way to automate JIRA. Support for py27 was dropped on 2019-10-14, do not raise bugs related to it.

Jira Python Library This library eases the use of the Jira REST API from Python and it has been used in production for years. As this is an open-sourc

PyContribs 1.7k Jan 06, 2023
Want to get your driver's license? Can't get a appointment because of COVID? Well I got a solution for you.

NJDMV-appoitment-alert Want to get your driver's license? Can't get a appointment because of COVID? Well I got a solution for you. We'll get you one i

Harris Spahic 3 Feb 04, 2022
RDMAss - A Python Discord bot creating an interaction with RDM API

RDMAss A Python Discord bot creating an interaction with RDM API. Features Assig

5 Sep 21, 2022
First Party data integration solution built for marketing teams to enable audience and conversion onboarding into Google Marketing products (Google Ads, Campaign Manager, Google Analytics).

Megalista Sample integration code for onboarding offline/CRM data from BigQuery as custom audiences or offline conversions in Google Ads, Google Analy

Google 76 Dec 29, 2022
Adriano's Diets Consulting Bot - Parses and extracts informations about your diet (files in the Adriano's format).

Adriano's Diets Consulting Bot - Parses and extracts informations about your diet (files in the Adriano's format).

Marco A. 2 Feb 07, 2022
veez music bot is a telegram music bot project, allow you to play music on voice chat group telegram.

🎢 VEEZ MUSIC BOT Veez Music is a telegram bot project that's allow you to play music on telegram voice chat group. Requirements πŸ“ FFmpeg NodeJS node

levina 143 Jun 19, 2022
Discord Rpc With Python And 2 Buttons

Discord-RPC-With-Python- Discord Rpc With Python And 2 Buttons Packages pypresence time Required Programs Python Latest Version Random IDE Discord :P

Kaz 4 Dec 12, 2021
File-sharing-Bot: Telegram Bot to store Posts and Documents and it can Access by Special Links.

BromΓ©lia HSS bromelia-hss is the second official implementation of a Diameter-based protocol application by using the Python micro framework BromΓ©lia.

1 Dec 17, 2021
eBay Scraper Homework 3 With Python

eBay Scraper Homework 3 Description of Code My ebay-dl.py file is programmed with python to download 6 key pieces of information - name, if there are

1 Nov 10, 2021
Python3 wrapper for the Sibyl System antispam API for telegram

SibylSystem-Py Python3 wrapper for the Sibyl System antispam API for telegram Installation pip install sibylsystem Usage from SibylSystem import

Kaizoku 6 Nov 04, 2022
Send automated wishes to your contacts at scheduled time through WhatsApp. Written for Raspberry pi.

Whatsapp Automated Wishes Helps to send automated wishes to your contacts in Whatsapp at scheduled time using pywhatkit . Written for Raspberry pi. Wi

Uthayamurthy 2 Dec 13, 2022
A superb Telegram VoiceChat Player. Powered by FalconRoBo.

π•±π–†π–‘π–ˆπ–”π–“π•Έπ–šπ–˜π–Žπ–ˆ A sα΄œα΄˜α΄‡Κ€Κ™ Tα΄‡ΚŸα΄‡Ι’Κ€α΄€α΄ VᴏΙͺᴄᴇCΚœα΄€α΄› PΚŸα΄€Κα΄‡Κ€, ᴍᴀᴅᴇ ᴜsΙͺΙ΄Ι’ Lᴀᴛᴇsα΄› PΚα΄›Κœα΄Ι΄ α΄€Ι΄α΄… Pʏʀᴏɒʀᴀᴍ. π‘·π’π’˜π’†π’“π’†π’… π’ƒπ’š 𝑭𝒂𝒍𝒄𝒐𝒏𝑹𝒐𝑩𝒐 FalconMusic

FalconRoBo 2 Oct 21, 2022
Code for paper "Adversarial score matching and improved sampling for image generation"

Adversarial score matching and improved sampling for image generation This repo contains the official implementation for the ICLR 2021 paper Adversari

Alexia Jolicoeur-Martineau 114 Dec 11, 2022
Simple Craigslist wrapper

python-craigslist A simple Craigslist wrapper. License: MIT-Zero. Disclaimer I don't work for or have any affiliation with Craigslist. This module was

Julio M. Alegria 370 Dec 22, 2022
Automatically mass follows tons of NameMC profiles.

Automatically mass follows tons of NameMC profiles. (Creates REAL traffic to your profile)

Jam 3 Jun 29, 2022
A Rich renderable for viewing Multiple Sequence Alignments in the terminal.

rich-msa A simple module to render colorful Multiple Sequence Alignment with rich in the terminal. πŸ”§ Installing Install the rich-msa package directly

Martin Larralde 64 Dec 04, 2022