Skip to content

TypeScript Express server utilizing the Telegram Bot API to create a chatbot for querying web-scraped pr0game player stats. Handles HTTP requests, JSON files, outputs nicely formatted ASCII messages.

Notifications You must be signed in to change notification settings

hangrybear666/express-pr0game-stats-chatbot

Repository files navigation

Express Pr0game Stats Chatbot

This GitHub repository hosts an Express server built with TypeScript that uses the Telegram Bot API to create a chatbot for querying automatically collected pr0game player stats. It handles HTTP requests, processes JSON files, outputs nicely formatted ASCII message.

Technologies Used

  • TypeScript: Statically typed JS with high strictness level and compile target ESNext.
  • Express: A minimalist web framework for Node.js used to build the server-side application.
  • Axios: A promise-based HTTP client for making requests to the backend API and handling asynchronous operations.
  • Morgan: HTTP request logger middleware for Node.js.
  • Node.js: A JavaScript runtime environment used for executing server-side code.
  • Telegram Bot API: Used for creating a Telegram chatbot to communicate extracted data from the JSON files to users.
  • Nodemon: Hot Reload upon file changes of the server during development, enhancing the development workflow.
  • ts-node: Executing TypeScript files directly without the need for compilation, enhancing the development workflow.
  • ESLint and Prettier: Linter and Formatter for ensuring code quality and enforcing coding standards.

Setup

Dependencies

  1. Node.js: Ensure that Node.js is installed on your local machine, with a minimum version of 14.x. You can download Node.js from here.

Installation

  1. Clone the Repository:
git clone https://github.com/your-username/express-pr0game-stats-chatbot.git
  1. Navigate to the Project Folder:
cd express-pr0game-stats-chatbot
  1. Install Dependencies:
npm install
  1. Configure Environment Variables:

    • Create a .env file in the root directory.
    • Define the following variables:
      • REST_PW
      • TELEGRAM_ADMIN_BOT_TOKEN
      • TELEGRAM_ADMIN_USER_CHAT_ID
      • TELEGRAM_ADMIN_BOT_USERNAME
      • TELEGRAM_CHAT_BOT_TOKEN
      • TELEGRAM_CHAT_BOT_USERNAME

Usage

  1. Run the Server:
npm run server
  1. Telegram Bot:

    • Start a conversation with your Telegram bot using the provided username.
    • Interact with the bot to receive data extracted from the JSON files.

Once the server is up and running, it will be ready to handle HTTP requests containing .json files and interact with users via Telegram and Discord chatbots.

License

This project is licensed under the MIT License.


About

TypeScript Express server utilizing the Telegram Bot API to create a chatbot for querying web-scraped pr0game player stats. Handles HTTP requests, JSON files, outputs nicely formatted ASCII messages.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published