Skip to content

A Telegram bot fetches and maintains the anime schedules from subsplease and updates a channel with the schedule along with images.

License

Notifications You must be signed in to change notification settings

CutieSoul/Anime-Schedule-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typing SVG

This is an Anime Schedule Telegram bot made with the Pyrogram library. The bot fetches and maintains the anime schedules from subsplease and updates a channel with the schedule along with images.

Features

v2.0

  • Fetches anime schedules and updates them every 15 minutes.

  • Posts random images from a specified directory with schedule post.

  • Each schedule post is pinned in the channel for easy access.

  • Every day at 12:15 AM, the bot deletes the old schedule post and sends a new one with the latest information is available.

  • Manually send the schedule (Sudo users only) by command.

  • Change the TimeZone for schedule fetching (Sudo users only) by command.

  • Check Status (Current TimeZone etc..).

  • Supports deployment on Koyeb.

v1.0

  • Functionality: Edits the scheduled message every 15 minutes.
  • Usage: Use v1.0 if you want to edit the current scheduled message.

Usage

  • /send - Manually send the schedule (Sudo users only)

  • /start - Check if bot alive

  • /status - Get the current status of the bot

  • /set_timezone [timezone] - Change the timezone for schedule fetching (Sudo users only)

To change the timezone, use the command followed by the desired timezone string.

Example:

/set_timezone America/New_York

Note: You can find valid timezone formats in the IANA time zone database.

Requirements

  • Python 3.7 or higher
  • Libraries:
    • aiohttp
    • pyrogram
    • apscheduler
    • pytz
    • python-dotenv
    • flask

Variables

  • API_ID : Your API ID from my.telegram.org

  • API_HASH : Your API HASH from my.telegram.org

  • BOT_TOKEN : Bot Token from @BotFather

  • MAIN_CHANNEL : Your Channel username (must start with @). This is where your bot will post schedule.

  • TIMEZONE : Your local timezone, formatted according to the IANA time zone database. For example, use America/New_York for Eastern Time.

  • SUDO_USERS : A comma-separated list of user IDs that have administrative privileges.

  • WEBHOOK : Set to True if you are running on Koyeb. Default is False.

Installation

  1. Clone the repository.

    sudo apt update
    sudo apt install git python3 python3-pip tmux
    git clone https://github.com/CutieSoul/Anime-Schedule-Bot && cd Anime-Schedule-Bot
  2. Configure the bot by editing .env with your Telegram API credentials, bot token, and other settings.

    nano .env
  3. Install Dependencies.

    pip3 install -r requirements.txt
  4. Run the Bot in tmux.

    tmux new -s schedule-bot  # Start a new tmux session named "schedule-bot"
    python3 bot.py         # Run the bot
    • To detach from the tmux session and leave the bot running, press Ctrl + B, then D.
    • To reattach to the session later, use:
      tmux attach -t schedule-bot

Deploy on Koyeb

The fastest way to deploy the application is to click the Deploy to Koyeb button below.

Deploy to Koyeb

Logging

  • The bot logs important actions to the console, which can help in debugging and monitoring its performance. You can adjust the logging level in the configuration if needed.

About

A Telegram bot fetches and maintains the anime schedules from subsplease and updates a channel with the schedule along with images.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published