Block Telegram's new

Overview

Telegram Channel Blocker Bot

Channel go away!


This bot is used to delete and ban message sent by channel

How this appears?

The reason this appears please see this contest hosted by Telegram

channels.sendAsPeers peers:Vector
   
     chats:Vector
    
      users:Vector
     
       = channels.SendAsPeers;

...

---functions---

...

channels.getSendAs peer:InputPeer = channels.SendAsPeers;

     
    
   

In the contest, Telegram added few new APIs. One of them is channels.sendAsPeers.
This API can send message as a channel peer.

This changes applied in both Development and Production server,
but in Production this behaves were limited. (Only channel admin can send as a channel peer)

Later (07-12-2021), Telegram released a new update that normal user can do the same thing, as they are owner of the channel peer.
So this bot is invented to solve this problem.

Currently, (07-12-2021) Telegram didn't add those APIs in the official Schema.

Install

Pre requirements:

  • Python 3.8+ (pypy should also support, but not tested.)

This project uses poetry to install dependencies.
Please install poetry globally by using pip install poetry

$ poetry init

Using version ^X.X.X for loguru
Using version ^X.X.X for Pyrogram
Using version ^X.X.X for TgCrypto
...

Updating dependencies
Resolving dependencies...

Writing lock file

Package operations: 8 installs, 0 updates, 0 removals

  • Installing async-lru (X.X.X)
  • Installing colorama (X.X.X)
  • Installing pyaes (X.X.X)
  • Installing pysocks (X.X.X)
  • Installing win32-setctime (X.X.X)
  • Installing loguru (X.X.X)
  • Installing pyrogram (X.X.X)
  • Installing tgcrypto (X.X.X)
...

$

How to use

Rename config.ini.example to config.ini and edit the config

Simply run this script with python3 main.py
and add it to your group, it will automatically start working.

Important note: You have to TURN OFF privacy mode for your bot via @BotFather using /setprivacy command

Note: You must give this bot permission to delete message and ban users.

Example bot

Running official bot: @Auto_Block_Channel_Bot
simply add in your group and give delete message and ban user permission and there you go!

Linked group will not affect the function

Contributing

Please follow Google Python Style Guide to write code.

Before submitting pull request, please make sure your code is able to run successfully.

You might also like...
Send notification to your telegram group/channel/private whenever a new video is uploaded on a youtube channel!

YouTube Feeds Bot. Send notification to your telegram group/channel/private whenever a new video is uploaded on a youtube channel! Variables BOT_TOKEN

A Telegram Bot which will ask new Group Members to verify them by solving an emoji captcha.

Emoji-Captcha-Bot A Telegram Bot which will ask new Group Members to verify them by solving an emoji captcha. About API: Using api.abirhasan.wtf/captc

Twitter bot that finds new friends in Twitter.

PythonTwitterBot Twitter Bot Thats Find New Friends pip install textblob pip install tweepy pip install googletrans check requirements.txt file Env

Written in Python, freezed into stand-alone executable with PyInstaller. This app will make sure you stay in New World without getting kicked for inactivity.
Written in Python, freezed into stand-alone executable with PyInstaller. This app will make sure you stay in New World without getting kicked for inactivity.

New World - AFK Written in Python, freezed into stand-alone executable with PyInstaller. This app will make sure you stay in New World without getting

Acid's Utilities is a bot for my Discord server that alerts when I go live, welcomes new users, has some awesome games and so much more!

Acid's Utilities Acid's Utilities is a bot for my Discord server that alerts when I go live, welcomes new users, has some awesome games and so much mo

This is a crypto trading bot that scans the Binance Annoucements page for new coins, and places trades on Gateio
This is a crypto trading bot that scans the Binance Annoucements page for new coins, and places trades on Gateio

gateio-trading-bot-binance-announcements This Gateio x Binance cryptocurrency trading bot scans the Binance Announcements page and picks up on new coi

A new coin listing alert bot using Python, Flask, MongoDB, Telegram API and Binance API
A new coin listing alert bot using Python, Flask, MongoDB, Telegram API and Binance API

Bzzmans New Coin Listing Detection Bot Architecture About Project Work in progress. This bot basically gets new coin listings from Binance using Binan

A mass creator for Discord's new channel threads.

discord-thread-flooder A mass creator for Discord's new channel threads. (obv created by https://github.com/imvast) Warning: this may lag ur pc if u h

Releases(0.1.4)
  • 0.1.4(Dec 9, 2021)

    Full Changelog: https://github.com/sam01101/TelegramChannelBlockerBot/compare/0.1.3...0.1.4

    Improvement

    • [fix] More exception added to prevent log spamming
    • [fix] Moved admin checking to top of function to prevent user calling unwanted APIs
    • [fix] Fix identifier typo
    • [fix] Fix mention mis-offset
    • [fix] Fix resolve peer error in get_channel_id
    • [fix] Fixed exceptions
    • [typo] Fixed logging typo
    • [improve] Function rename & Removed unnecessary Optional field
    Source code(tar.gz)
    Source code(zip)
  • 0.1.3(Dec 8, 2021)

    Full Changelog: https://github.com/sam01101/TelegramChannelBlockerBot/compare/0.1.1...0.1.3

    Why jumped to 0.1.3 and skipped 0.1.2? These two version are so close (Only 1 commit diff) so 0.1.2 are ignored

    What is new

    • [update] Update dep pyrogram to 1.2.19
    • [typo] Improve logging message
    • [fix] Request looping when missing permission(s)
    • [refactor] Refactor whole code for cleaner reading
    • [add] Added sql scripts
    • [enchant] Linked group ID will be cached for 5 minutes each time
    • [enchant] Channel ban improvement
    • [add] Added whitelist function
    • [add] Added command /stat, /is, /cwl, /crm, /start and `/help
    • [fix] Fix debug logging spamming of unbanning channels
    • [fix] Fix missing exception at message_handler
    • [fix] Removed utf-16 encoding that cause error
    • [fix] Fixed command name unable to call problem
    • [fix] Fixed command name unable to call problem
    • [fix] Fixed log spamming with invalid username

    New feature

    • Whitelist
    • Statistics (For counting banned channel)

    New commands

    • start
    • help
    • stat
    • is
    • cwl
    • crm
    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Dec 8, 2021)

    Full Changelog: https://github.com/sam01101/TelegramChannelBlockerBot/compare/0.1.0...0.1.1

    • [improve] Remove using get_chat * Note: I’ve noticed that it’s getting huge rate limit when using get_chat, hope this checking won’t be cracked.
    • [fix] Fix wrong exception attribute
    • [fix] Fixed CHAT_ADMIN_REQUIRED error spamming
    • [feat] Added banned message will show up in debug logging
    • [fix] Ignore nicked admin sending message to be deleted
    • [fix] Fix message will also delete linked channel
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Dec 8, 2021)

Download archived malware from ActiveState's source code mirror

malware-archivist (ma) Tool to aid security researchers in dissecting malware. Often, repository maintainers will remove malicious packages entirely f

ActiveState Software 28 Dec 12, 2022
Discord Mass Edit is a unique, purging related Discord tool that differs from the regular mass delete.

Discord Mass Edit is a unique, purging related Discord tool that differs from the regular mass delete. This tool will automatically edit every message in a chosen channel and change it to a random st

c0mpt0 1 Jul 27, 2022
unofficial source of the discord bot, “haunting.” created by: vorqz, vert, & Veltz

hauntingSRC unofficial source of the discord bot, “haunting.” created by: vorqz, vert, & Veltz reasoning: creators skidded the most of this bot and do

Vast 11 Nov 04, 2022
Diablo II Resurrected Diablo Clone Running Room Mgr

d2rdc Diablo II Resurrected Diablo Clone Running Room Mgr Install Dependencies pip install fastapi pip install uvicorn Running uvicorn init:app INFO:

1 Dec 03, 2021
Project made to analyse movie trends

MovieTrends Project to analyse the daily movie trends from the website The Movie DataBase. The main idea is upload the results to a PostgreSQL server

Jazmín López Chacón 0 Feb 15, 2022
Sunflower-farmers-automated-bot - Sunflower Farmers NFT Game automated bot.IT IS NOT a cheat or hack bot

Sunflower-farmers-auto-bot Sunflower Farmers NFT Game automated bot.IT IS NOT a

Arthur Alves 17 Nov 09, 2022
Declarative assertions for AWS

AWSsert AWSsert is a Python library providing declarative assertions about AWS resources to your tests. Installation Use the package manager pip to in

19 Jan 04, 2022
A simpler way to make forms, surveys, and reaction input using discord.py.

discord-ext-forms An easier way to make forms and surveys in discord.py. This module is a very simple way to ask questions and create complete forms i

thrizzle 16 Nov 06, 2022
A complete Python application to automatize the process of uploading files to Amazon S3

Upload files or folders (even with subfolders) to Amazon S3 in a totally automatized way taking advantage of: Amazon S3 Multipart Upload: The uploaded

Pol Alzina 1 Nov 20, 2021
E0 AI Bot is based on the message, it prints the answer with the highest probability using probability from the database.

E0 AI Chat Bot Based on the message, it prints the answer with the highest probability using probability from the database. Install on linux (Arch,Deb

Error 27 Dec 03, 2022
We propose the adversarial blur attack (ABA) against visual object tracking.

ABA We propose the adversarial blur attack (ABA) against visual object tracking. The ICCV link: https://arxiv.org/abs/2107.12085 and, https://openacce

Qing Guo 13 Dec 01, 2022
Twitter-bot - A Simple Twitter bot with python

twitterbot To use this bot, You will require API Key and Access Key. Signup at h

Bentil Shadrack 8 Nov 18, 2022
Fully asynchronous trace.moe API wrapper

AioMoe Fully asynchronous trace.moe API wrapper Installation You can install the stable version from PyPI: $ pip install aiomoe Or get it from github

2 Jun 26, 2022
Match-making API for OpenSanctions

OpenSanctions Match-making API This directory contains code and a Docker image for running an API to match data against OpenSanctions. It is intended

OpenSanctions.org 26 Dec 15, 2022
A Python AWS Lambda Webhook listener that generates a permanent URL when an asset is created in Contentstack.

Webhook Listener A Python Lambda Webhook Listener - Generates a permanent URL on created assets. See doc on Generating a Permanent URL: https://www.co

Contentstack Solutions 1 Nov 04, 2021
Reddit cli to slack at work

Reddit CLI (v1.0) Introduction Why Reddit CLI? Coworker who sees me looking at something in a browser: "Glad you're not busy; I need you to do this, t

3 Jun 22, 2021
Python bindings for BigML.io

BigML Python Bindings BigML makes machine learning easy by taking care of the details required to add data-driven decisions and predictive power to yo

BigML Inc, Machine Learning made easy 271 Dec 27, 2022
This is simple maker for level card in discord bot.

mariocard This is simple maker for level card in discord bot in discord.py or pycord. Installing Python 3.8 or higher is required # Linux/macOS pip3 i

3 Jan 29, 2022
A python package to easy the integration with Direct Online Pay (Mpesa, TigoPesa, AirtelMoney, Card Payments)

A python package to easy the integration with Direct Online Pay (DPO) which easily allow you easily integrate with payment options once without having to deal with each of them individually;

Jordan Kalebu 2 Nov 25, 2021
Telegram Bot to save Posts or Files that can be Accessed via Special Links

OKAERI-FILE Bot Telegram untuk menyimpan Posting atau File yang dapat Diakses melalui Link Khusus. Jika Anda memerlukan tambahan module lagi dalam rep

Wahyusaputra 5 Aug 04, 2022