All Projects → IDN-C-X → ZeldrisRobot

IDN-C-X / ZeldrisRobot

Licence: GPL-3.0 license
An anime themed group management bot, running on python with telethon and ptb.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to ZeldrisRobot

tg-inviter
Generate personal invite links for Telegram channels
Stars: ✭ 26 (-36.59%)
Mutual labels:  python-telegram-bot, telethon
allukabot
Modular HunterxHunter themed Telegram Bot for managing your group with additional features.
Stars: ✭ 21 (-48.78%)
Mutual labels:  python-telegram-bot, telethon
AI-Lossless-Zoomer
AI无损放大工具
Stars: ✭ 940 (+2192.68%)
Mutual labels:  anime
BotListBot
Repository of Telegram's BotListBot
Stars: ✭ 55 (+34.15%)
Mutual labels:  python-telegram-bot
waifu-generator
Let's pick up your favorite waifu just from the API
Stars: ✭ 31 (-24.39%)
Mutual labels:  anime
crunchyroll-dl
A fast, modern, and beautiful Crunchyroll downloader.
Stars: ✭ 111 (+170.73%)
Mutual labels:  anime
animedoro-timer
An Animedoro timer for all the weebs out there | productivity : 📈
Stars: ✭ 37 (-9.76%)
Mutual labels:  anime
WaifuLite
Super Resolution for Anime image, lightweight implementation
Stars: ✭ 20 (-51.22%)
Mutual labels:  anime
myanimelist-api-v2
An awesome wrapper on Nodejs for the new MyAnimeList's API v2!
Stars: ✭ 30 (-26.83%)
Mutual labels:  anime
SD-streams
Anime streaming without ads using Beautifulsoup and requests Python
Stars: ✭ 18 (-56.1%)
Mutual labels:  anime
Spotify-Telegram-Bio-Updater
Spotify Telegram Bio Updater Heroku Integration
Stars: ✭ 26 (-36.59%)
Mutual labels:  telethon
Animex
This is a single page application which allows users to browse and view a catalog of anime series and movies. Built with React/Redux.
Stars: ✭ 31 (-24.39%)
Mutual labels:  anime
CR-dl
A Crunchyroll downloader
Stars: ✭ 88 (+114.63%)
Mutual labels:  anime
nyaascraper
An application to scrape and open magnet links for fansub groups from nyaa.si where batches don't already exist.
Stars: ✭ 34 (-17.07%)
Mutual labels:  anime
telegram
A Matrix-Telegram hybrid puppeting/relaybot bridge
Stars: ✭ 914 (+2129.27%)
Mutual labels:  telethon
AniAPI
Core behind AniAPI HTTP Rest APIs.
Stars: ✭ 144 (+251.22%)
Mutual labels:  anime
Anifiltrs
A collection of filter lists for anime streaming, manga reading, and downloading of such things.
Stars: ✭ 142 (+246.34%)
Mutual labels:  anime
animeflv
Animeflv is a custom API that has the entire catalog of the animeflv.net website. You can enjoy all the content with subtitles in Spanish and the latest in the world of anime for free.
Stars: ✭ 37 (-9.76%)
Mutual labels:  anime
SophiaBot
Hi There ✋ I'M Sophia 3.0 ❤️ NEW VERSION OF SOPHIA.. Source Code of @SophiaSLBot.
Stars: ✭ 44 (+7.32%)
Mutual labels:  telethon
windows-app
Official LISTEN.moe Windows-only Client
Stars: ✭ 63 (+53.66%)
Mutual labels:  anime

Zeldris Robot

Support Chat Update Channel
Zeldris on Telegram
CodeFactor
DeepSource
Python Telegram Bot Code style: black
Telethon Python
Open Source Maintenance
License PRs





A modular Telegram Python bot running on python3 with a sqlalchemy, redis, telethon.

How to set up/deploy.

Step to self Host!!

Setting up the bot (Read this before trying to use!):

Please make sure to use python3.6, as I cannot guarantee everything will work as expected on older Python versions! This is because markdown parsing is done by iterating through a dict, which is ordered by default in 3.6.

Configuration

There are two possible ways of configuring your bot: a config.py file, or ENV variables.

The preferred version is to use a config.py file, as it makes it easier to see all your settings grouped together. This file should be placed in your zeldris folder, alongside the __main__.py file. This is where your bot token will be loaded from, as well as your database URI (if you're using a database), and most of your other settings.

It is recommended to import sample_config and extend the Config class, as this will ensure your config contains all defaults set in the sample_config, hence making it easier to upgrade.

An example config.py file could be:

from zeldris.sample_config import Config

class Development(Config):
    OWNER_ID = 123456789  # your telegram ID
    OWNER_USERNAME = "username"  # your telegram username
    TOKEN = "your bot token"  # your bot token, as provided by the @botfather
    SQLALCHEMY_DATABASE_URI = 'postgresql://username:password@localhost:5432/database'  # sample db credentials
    MESSAGE_DUMP = '-10007372' # some group chat that your bot is a member of
    USE_MESSAGE_DUMP = True
    SUDO_USERS = [1234, 1234]  # List of id's for users which have sudo access to the bot.
    LOAD = []
    NO_LOAD = ['translation']
    MONGO_URI = ""
    MONGO_PORT = 27017  # leave it as it is
    MONGO_DB = "Zeldris"

If you can't have a config.py file (EG on Heroku), it is also possible to use environment variables. The following env variables are supported:

  • ENV: Setting this to ANYTHING will enable env variables

  • TOKEN: Your bot token, as a string.

  • OWNER_ID: An integer of consisting of your owner ID

  • OWNER_USERNAME: Your username

  • DATABASE_URL: Your database URL

  • MESSAGE_DUMP: optional: a chat where your replied saved messages are stored, to stop people deleting their old

  • LOAD: Space-separated list of modules you would like to load

  • NO_LOAD: Space-separated list of modules you would like NOT to load

  • WEBHOOK: Setting this to ANYTHING will enable webhooks when in env mode messages

  • URL: The URL your webhook should connect to (only needed for webhook mode)

  • MONGO_URI: Your mongodb url

  • MONGO_PORT: Your mongodb port

  • MONGO_DB: Your mongodb name

  • SUDO_USERS: A space-separated list of user_ids which should be considered sudo users

  • DEV_USERS: A space-separated list of user_ids which should be considered dev users

  • SUPPORT_USERS: A space-separated list of user_ids which should be considered support users (can gban/ungban, nothing else)

  • WHITELIST_USERS: A space-separated list of user_ids which should be considered whitelisted - they can't be banned.

  • DONATION_LINK: Optional: link where you would like to receive donations.

  • CERT_PATH: Path to your webhook certificate

  • PORT: Port to use for your webhooks

  • DEL_CMDS: Whether to delete commands from users which don't have rights to use that command

  • STRICT_GBAN: Enforce gbans across new groups as well as old groups. When a gbanned user talks, he will be banned.

  • WORKERS: Number of threads to use. 8 is the recommended (and default) amount, but your experience may vary. Note that going crazy with more threads won't necessarily speed up your bot, given the large amount of sql data accesses, and the way python asynchronous calls work.

  • BAN_STICKER: Which sticker to use when banning people.

  • ALLOW_EXCL: Whether to allow using exclamation marks ! for commands as well as /.

Python dependencies

Install the necessary Python dependencies by moving to the project directory and running:

pip3 install -U -r requirements.txt.

This will install all the necessary python packages.

Database

If you wish to use a database-dependent module (eg: locks, notes, userinfo, users, filters, welcomes), you'll need to have a database installed on your system. I use Postgres, so I recommend using it for optimal compatibility.

In the case of Postgres, this is how you would set up a database on a Debian/ubuntu system. Other distributions may vary.

  • install postgresql:

sudo apt-get update && sudo apt-get install postgresql

  • change to the Postgres user:

sudo su - postgres

  • create a new database user (change YOUR_USER appropriately):

createuser -P -s -e YOUR_USER

This will be followed by you need to input your password.

  • create a new database table:

createdb -O YOUR_USER YOUR_DB_NAME

Change YOUR_USER and YOUR_DB_NAME appropriately.

  • finally:

psql YOUR_DB_NAME -h YOUR_HOST YOUR_USER

This will allow you to connect to your database via your terminal. By default, YOUR_HOST should be 0.0.0.0:5432.

You should now be able to build your database URI. This will be:

sqldbtype://username:pw@hostname:port/db_name

Replace sqldbtype with whichever DB you're using (e.g. Postgres, MySQL, SQLite, `etc.) repeat for your username, password, hostname (localhost?), port (5432?), and DB name.

Or, register on ElephantSQL for free Postgresql. Learn for your self, We won't teach you anything.

Credits

Projects!

Zeldris is part of the [IDNCoder](https://github.com/IDN-C-X) project.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].