A modular Telegram Python bot running on python3 with a sqlalchemy, redislab, mongo database, telethon, and pyrogram.

Overview

Zeldris Robot

Support Chat Update Channel
Zeldris on Telegram
Codacy Codefactor
DeepSource
Python Telegram Bot
Telethon Pyrogram
Python
Open Source Maintenance
License PRs





A modular Telegram Python bot running on python3 with a sqlalchemy, redislab, mongo database, telethon, and pyrogram.

How to set up/deploy.

Steps 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 ZeldrisRobot.sample_config import Config

class Development(Config):
    OWNER_ID = 123456789  # your telegram ID
    OWNER_USERNAME = "username"  # your telegram username
    API_KEY = "your bot api key"  # your api key, as provided by the @botfather
    SQLALCHEMY_DATABASE_URI = 'postgresql://username:[email protected]: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']

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)

  • 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 -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:[email protected]: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, I won't learn you anything.

Credits

  • Skyleebot This bot Based
  • 1maverick1 for many stuffs.
  • AyraHikari for weather modules and some other stuffs.
  • RealAkito for reverse search modules.
  • MrYacha for connections module
  • ATechnoHazard for many stuffs
  • corsicanu and nunopenim for android modules Any other missing Credits can be seen in commits!
Owner
IDNCoderX
IDNCoderX
Telegram Userbot to steram youtube live or Youtube vido in telegram vc by help of pytgcalls

TGVCVidioPlayerUB Telegram Userbot to steram youtube live or youtube vidio in telegram vc by help of pytgcalls Commands = Vidio Playing 🎧 stream :

Achu biju 3 Oct 28, 2022
SickNerd aims to slowly enumerate Google Dorks via the googlesearch API then requests found pages for metadata

CLI tool for making Google Dorking a passive recon experience. With the ability to fetch and filter dorks from GHDB.

Jake Wnuk 21 Jan 02, 2023
An Anime Theme Telegram group management bot. With lot of features.

Emilia Project Emilia-Prjkt is a modular bot running on python3 with anime theme and have a lot features. Easiest Way To Deploy On Heroku This Bot is

ZenitsuID #M•R•T™ 3 Feb 03, 2022
Simple Telegram Bot to extract various types of archives from a telegram file or a direct link

Unzipper Bot A Telegram Bot to Extract Various Types Of Archives Features Extract various types of archives like rar, zip, tar, 7z, tar.xz etc. Passwo

I'm Not A Bot #Left_TG 93 Dec 27, 2022
search different Streaming Platforms for movie titles.

Install git clone and cd to directory install Selenium download chromedriver.exe to same directory First Run Use --setup True for the first run. Platf

34 Dec 25, 2022
Analytics platform for Telegram Channels

Tele-Report Analytics platform for Telegram Channels 🚧 👷 Getting Started 1- Install redis and postgreSQL (it would be more generic in future, like u

2 Oct 11, 2022
PyDottie is a version of Dottie.js written in Python 3.

PyDottie is a version of Dottie.js written in Python 3.

Jose Noriega 2 Nov 21, 2021
Open Source Discord bot with many cool features like Weather, Balance, Avatar, User, Server, RP-commands, Gif search, YouTube search, VK post search etc.

Сокобот Дискорд бот с открытым исходным кодом. Содержит в себе экономику, полезные команды (!аватар, !юзер, !сервер и тд.), рп-команды (!обнять, !глад

serverok 2 Jan 16, 2022
PyManGenerator is a token generator for discord, it joins servers using webbot to automate everything

PyManGenerator is a token generator for discord, it joins servers using webbot to automate everything. Captcha can be done by itself unless you used your current IP Address more than once.

5 Nov 27, 2021
A stock information collector and parser for Taiwan and US market. Automatically send LINE message if the pre-defined rules are triggered.

agastock 開發動機 就在海運飆漲的2021年7月,差點跪在地上喜迎財富自由的當下,EPS超高好消息不斷的長榮竟然套在202元一去不回,有圖有真相(哭) 忽然體會到追高殺低不是辦法,魯蛇我得靠邏輯分析也能出頭天,經過三個月無數個不出門的周末,產出簡單的爬蟲和分析工具。 上過金融研訓院的量化交易

Gavin Lee 12 Nov 16, 2022
A python package that allows you to place automated trades using the TD Ameritrade API.

Template Repo Table of Contents Overview Setup Usage Support These Projects Overview Setup Setup - Requirements Install:* For this particular project,

Alex Reed 4 Jan 25, 2022
A discord token nuker With loads of options that will screw an account up real bad, also has inbuilt massreport, GroupChat Spammer and Token/Password/Creditcard grabber and so much more!

Installation | Important | Changelogs | Discord NOTE: Hazard is not finished! You can expect bugs, crashes, and non-working functions. Please make an

Rdimo 470 Aug 09, 2022
BLYRIC is a Twitter bot that tweets a song lyric every night.

BLYRIC BLYRIC, a bot that tweets a song lyric every night. Follow on Twitter: @blyric_ Overview BLYRIC is a Twitter bot that tweets a song quote every

Bruno Kenzo Hyodo 6 Oct 05, 2022
ChannelActionsBot - Channel Actions Bot With Python

ChannelActionsBot Can be found on telegram as @ChannelActionsBot! Features Auto

Aditya 56 Dec 30, 2022
Bot for automated buying boxes on Binance

V 1.0 Bot for automated buying boxes on Binance В settings.py выставляем свои COOKIE и свой CSRFTOKEN В settings.py для headers выставляем свои параме

Matvey 3 Jan 18, 2022
Plays air warning sound when detects a certain phrase or a word in a specified Telegram chat.

Tryvoha Bot Disclaimer: this is more a convenient naming, rather than a real bot. It is designed to play air warning sound when detects a certain phra

Dmytro Novikov 2 Mar 02, 2022
Aplicação dos metodos de classificação em 3 diferentes banco de dados. Usando...

Machine Learning - Métodos de classificação Base de Dados utilizadas: Dados de crédito Dados do Census Métodos de classificação aplicados: Naive Bayes

1 Jan 18, 2022
A stable and Fast telegram video convertor bot which can compress, convert(video into audio and other video formats), rename with permanent thumbnail and trim.

ᴠɪᴅᴇᴏ ᴄᴏɴᴠᴇʀᴛᴏʀ A stable and Fast telegram video convertor bot which can compress, convert(video into audio and other video formats), rename and trim.

Mahesh Chauhan 183 Jan 04, 2023
A Discord bot to play bluffing games like Dobbins or Bobbins

Usage: pip install -r requirements.txt python3 bot.py DISCORD_BOT_TOKEN Gameplay: All commands are case-insensitive, with trailing punctuation and spa

4 May 27, 2022
Extend the commitizen tools to create conventional commits and README that link to Jira and GitHub.

cz-github-jira-conventional cz-github-jira-conventional is a plugin for the commitizen tools, a toolset that helps you to create conventional commit m

12 Dec 13, 2022