Code Monkey home page Code Monkey logo

force-subscribe-telegram-bot's Introduction

Introduction

A Telegram Bot to force users to join a specific channel before sending messages in a group.

Todo

  • Add multiple channels support

Deploy

Deploy

Installing Prerequisite

  • On Ubuntu 18.04 or later
sudo apt-get install git python3 python3-pip libpq-dev

Installation

  • Clone this repo
git clone https://github.com/viperadnan-git/force-subscribe-telegram-bot
  • Change directory
cd force-subscribe-telegram-bot
  • Install requirements
pip3 install -r requirements.txt

Configuration

Add APP_ID, API_HASH, BOT_TOKEN in Config.py or in Environment Variables.

Deploying

  • Run bot.py
python3 bot.py

Thanks to

force-subscribe-telegram-bot's People

Contributors

viperadnan-git avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

force-subscribe-telegram-bot's Issues

I want it to warn the user if they don't join

I want it to warn the user instead of mute like i set 5 warns so if the user sends message without joining channel it will warn him 1/5 and again if he sends without without joining channel it will warn him 2/5 like that please implement it

API ERROR

Whenever i try to deploy the app, then an api error comes. I don't know why it come, I added all the details including API ID and HASH correctly. Please repair it soon.

dont work

The bot starts but doesn't work.
Doesn't send anything in the group.

P.S. works only with the help of the bot.

Run issue

Anyone had this issue?

File "bot.py", line 23, in
app.run()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/pyrogram/methods/utilities/run.py", line 61, in run
self.start()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/pyrogram/sync.py", line 51, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/pyrogram/methods/utilities/start.py", line 68, in start
await self.initialize()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/pyrogram/methods/auth/initialize.py", line 44, in initialize
self.load_plugins()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/pyrogram/client.py", line 739, in load_plugins
module = import_module(module_path)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/runner/force-subscribe-telegram-bot/plugins/forceSubscribe.py", line 5, in
from sql_helpers import forceSubscribe_sql as sql
File "/home/runner/force-subscribe-telegram-bot/sql_helpers/init.py", line 17, in
SESSION = start()
File "/home/runner/force-subscribe-telegram-bot/sql_helpers/init.py", line 9, in start
engine = create_engine(Config.DATABASE_URL)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/sqlalchemy/engine/init.py", line 520, in create_engine
return strategy.create(*args, **kwargs)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/sqlalchemy/engine/strategies.py", line 54, in create
u = url.make_url(name_or_url)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/sqlalchemy/engine/url.py", line 229, in make_url
return _parse_rfc1738_args(name_or_url)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/sqlalchemy/engine/url.py", line 290, in _parse_rfc1738_args
raise exc.ArgumentError(
sqlalchemy.exc.ArgumentError: Could not parse rfc1738 URL from string ''

unable to run on heroku

getting this error please help me

2022-04-08T14:11:14.509326+00:00 app[worker.1]: return future.result()
2022-04-08T14:11:14.509326+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/pyrogram/methods/utilities/start.py", line 53, in start
2022-04-08T14:11:14.509327+00:00 app[worker.1]: is_authorized = await self.connect()
2022-04-08T14:11:14.509327+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/pyrogram/methods/auth/connect.py", line 38, in connect
2022-04-08T14:11:14.509328+00:00 app[worker.1]: self.load_config()
2022-04-08T14:11:14.509328+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/pyrogram/client.py", line 613, in load_config
2022-04-08T14:11:14.509329+00:00 app[worker.1]: raise AttributeError("No API Key found. More info: https://docs.pyrogram.org/intro/setup")
2022-04-08T14:11:14.509329+00:00 app[worker.1]: AttributeError: No API Key found. More info: https://docs.pyrogram.org/intro/setup
2022-04-08T14:11:14.759577+00:00 heroku[worker.1]: Process exited with status 1
2022-04-08T14:11:14.957126+00:00 heroku[worker.1]: State changed from up to crashed

SyntaxWarning

/root/force-subscribe-telegram-bot-master/plugins/forceSubscribe.py:71: SyntaxWarning: "is" with a literal. Did you mean "=="?
if user.status is "creator" or user.user.id in Config.SUDO_USERS:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.