Skip to content

Commit 31020ad

Browse files
authored
Update To V0.0.5 🔥
0 parents  commit 31020ad

File tree

10 files changed

+274
-0
lines changed

10 files changed

+274
-0
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM python:3.10
2+
WORKDIR /app
3+
COPY . /app/
4+
RUN pip install -r requirements.txt
5+
CMD ["python", "bot.py"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Biisal
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Procfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
web: python bot.py
2+
worker: python bot.py

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<img src="https://telegra.ph/file/21a8e96b45cd6ac4d3da6.jpg" alt="logo" target="/blank">
2+
3+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
4+
<h1 align= center>Auto Caption Bot</h1>
5+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif">
6+
7+
<p align="center">💜 Thanks for Being Here 💜</p>
8+
9+
<p align='center'><b><li>This bot can edit the captions of the videos, audios, or documents when they are uploaded to the channel</b></p>
10+
<br>
11+
12+
## <li> Deployment Methods
13+
14+
<details><summary>📌 Deploy to Koyeb </summary>
15+
16+
[![Deploy to Koyeb](https://www.koyeb.com/static/images/deploy/button.svg)](https://app.koyeb.com/deploy?type=git&repository=github.com/RknDeveloper/Rkn-AutoCaptionBot&env[BOT_TOKEN]&env[API_ID]&env[API_HASH]&env[ADMIN]&env[DB_NAME]&env[DB_URI]&env[FORCE_SUB]&env[RKN_PIC]=https://graph.org/file/f6c15009bce07058f1edb.jpg&env[DEF_CAP]&run_command=python%20bot.py&branch=main&name=Rkn-AutoCaptionBot)
17+
</details>
18+
19+
<details><summary>📌 Deploy to Render </summary>
20+
21+
[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/RknDeveloper/Rkn-AutoCaptionBot)
22+
23+
</details>
24+
25+
<details><summary>📌 Deploy to Heroku </summary>
26+
27+
<a href="https://heroku.com/deploy?template=https://github.com/RknDeveloper/Rkn-AutoCaptionBot"> <img src="https://img.shields.io/badge/Deploy%20To%20Heroku-black?style=for-the-badge&logo=heroku" width="220" height="38.45"></p></a>
28+
</details>
29+
30+
<details><summary>📌 Deploy to Railway </summary>
31+
32+
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/w7jSPk)
33+
</details>
34+
35+
## 🥰 Features
36+
37+
* Channel Auto Caption Edit.
38+
* Set Caption support.
39+
* Force join for the user for use.
40+
* Supports Broadcasts.
41+
* Unlimited Channel Support.
42+
* Has a custom Start-up pic.
43+
* Force subscribe available.
44+
* Admin Commond Available.
45+
* Deploy to Koyeb + Heroku + Railway + Render + Vps.
46+
* Developer Service 24x7. 🔥
47+
48+
## <li> Configs
49+
* `BOT_TOKEN` - Get Bot Token From @BotFather
50+
* `API_ID` - From my.telegram.org
51+
* `API_HASH` - From my.telegram.org
52+
* `ADMIN` - AUTH Or Bot Controllers Id's Multiple Id Use Space To Split
53+
* `DB_URL` - Mongo Database URL From https://cloud.mongodb.com
54+
* `DB_NAME` - Your Database Name From Mongodb.
55+
* `FORCE_SUB` - Your Force Sub Channel Username Without @
56+
* `DEF_CAP` - YOUR DEFAULT CAPTION USE {file_name} TO SHOW FILE NAME
57+
58+
## Botfather Commands
59+
```
60+
start - Bᴏᴛ Aʟɪᴠᴇ Cʜᴇᴄᴋɪɴɢ
61+
restart - Tᴏ Rᴇsᴛᴀʀᴛ Tʜᴇ Bᴏᴛ (Aᴅᴍɪɴ ᴏɴʟʏ)
62+
status - ᴄʜᴇᴄᴋ ʙᴏᴛ sᴛᴀᴛᴜs (ᴀᴅᴍɪɴ ᴏɴʟʏ)
63+
broadcast - sᴇɴᴅ ᴍᴀssᴀɢᴇ ᴛᴏ ᴀʟʟ ᴜsᴇʀs (ᴀᴅᴍɪɴ ᴏɴʟʏ)
64+
```
65+
66+
## Support
67+
* [![Support](https://img.shields.io/static/v1?label=Support&message=Group&color=critical)](https://t.me/Rkn_Bots_Support)
68+
* [![Updates](https://img.shields.io/static/v1?label=Updates&message=Channel&color=critical)](https://t.me/Rkn_Bots)
69+
70+
## Credits
71+
* [![RknDeveloper](https://img.shields.io/static/v1?label=Rkn&message=Developer&color=critical)](https://t.me/RknDeveloper)

app.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "Rkn-AutoCaptionBot",
3+
"description": "Telegram Channel Auto Caption Bot ",
4+
"logo": "https://telegra.ph/file/21a8e96b45cd6ac4d3da6.jpg",
5+
"keywords": ["AutoCaptionBot", "Mongo DB"],
6+
"repository": "https://github.com/RknDeveloper/Rkn-AutoCaptionBot",
7+
"env": {
8+
"API_ID": {
9+
"description": "Your APP ID From my.telegram.org ",
10+
"value": ""
11+
},
12+
"API_HASH": {
13+
"description": "Your API Hash From my.telegram.org ",
14+
"value": ""
15+
},
16+
17+
"FORCE_SUB": {
18+
"description": "Your force sub channel user name without [@] ",
19+
"value": "",
20+
"required": false
21+
},
22+
"BOT_TOKEN": {
23+
"description": "Your Bot Token From @BotFather",
24+
"value": ""
25+
},
26+
"ADMIN": {
27+
"description":"Add Your User ID multiple is use space to split"
28+
},
29+
30+
"DB_URL": {
31+
"description": "Your Mongo DB URL Obtained From mongodb.com",
32+
"value": ""
33+
},
34+
"DB_NAME":{
35+
"description":"Your Mongo DB Database Name ",
36+
"value": "SnowPro_Users",
37+
"required": false
38+
},
39+
"START_PIC": {
40+
"description": "Your Bot start cmd Pic from @Rkn_TelegraPH_Bot",
41+
"value": "",
42+
"required": false
43+
}
44+
},
45+
"buildpacks": [
46+
{
47+
"url": "heroku/python"
48+
}
49+
]
50+
}

bot.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# (c) @RknDeveloperr
2+
# Rkn Developer
3+
# Don't Remove Credit 😔
4+
# Telegram Channel @RknDeveloper & @Rkn_Bots
5+
# Developer @RknDeveloperr
6+
7+
from aiohttp import web
8+
from pyrogram import Client
9+
from config import Rkn_Bots
10+
from Rkn_Bots.web_support import web_server
11+
12+
class Rkn_AutoCaptionBot(Client):
13+
def __init__(self):
14+
super().__init__(
15+
name="Rkn-AutoCaptionBot",
16+
api_id=Rkn_Bots.API_ID,
17+
api_hash=Rkn_Bots.API_HASH,
18+
bot_token=Rkn_Bots.BOT_TOKEN,
19+
workers=200,
20+
plugins={"root": "Rkn_Bots"},
21+
sleep_threshold=15,
22+
)
23+
24+
async def start(self):
25+
await super().start()
26+
me = await self.get_me()
27+
self.force_channel = Rkn_Bots.FORCE_SUB
28+
if Rkn_Bots.FORCE_SUB:
29+
try:
30+
link = await self.export_chat_invite_link(Rkn_Bots.FORCE_SUB)
31+
self.invitelink = link
32+
except Exception as e:
33+
print(e)
34+
print("Make Sure Bot admin in force sub channel")
35+
self.force_channel = None
36+
app = web.AppRunner(await web_server())
37+
await app.setup()
38+
bind_address = "0.0.0.0"
39+
await web.TCPSite(app, bind_address, Rkn_Bots.PORT).start()
40+
print(f"{me.first_name} Iꜱ Sᴛᴀʀᴛᴇᴅ.....✨️")
41+
await self.send_message(Rkn_Bots.ADMIN, f"**__{me.first_name} Iꜱ Sᴛᴀʀᴛᴇᴅ.....✨️__**")
42+
43+
async def stop(self, *args):
44+
await super().stop()
45+
print("Bot Stopped 🙄")
46+
47+
Rkn_AutoCaptionBot().run()
48+
49+
# Rkn Developer
50+
# Don't Remove Credit 😔
51+
# Telegram Channel @RknDeveloper & @Rkn_Bots
52+
# Developer @RknDeveloperr

config.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# (c) @RknDeveloperr
2+
# Rkn Developer
3+
# Don't Remove Credit 😔
4+
# Telegram Channel @RknDeveloper & @Rkn_Bots
5+
# Developer @RknDeveloperr
6+
7+
import re, os, time
8+
id_pattern = re.compile(r'^.\d+$')
9+
10+
class Rkn_Bots(object):
11+
# Rkn client config
12+
API_ID = os.environ.get("API_ID", "")
13+
API_HASH = os.environ.get("API_HASH", "")
14+
BOT_TOKEN = os.environ.get("BOT_TOKEN", "")
15+
16+
# wes response configuration
17+
BOT_UPTIME = time.time()
18+
PORT = int(os.environ.get("PORT", "8080"))
19+
FORCE_SUB = os.environ.get("FORCE_SUB", "")
20+
21+
# database config
22+
DB_NAME = os.environ.get("DB_NAME","")
23+
DB_URL = os.environ.get("DB_URL", "")
24+
25+
#caption
26+
DEF_CAP = os.environ.get("DEF_CAP",
27+
"<b><a href='telegram.me/Rkn_Bots'>{file_name} Telegram : @RknDeveloper\n\nForward the file before Downloading.</a></b>",
28+
)
29+
30+
#sticker Id
31+
STICKER_ID = os.environ.get("STICKER_ID", "CAACAgIAAxkBAAELFqBllhB70i13m-woXeIWDXU6BD2j7wAC9gcAAkb7rAR7xdjVOS5ziTQE")
32+
33+
#admin id
34+
ADMIN = [int(admin) if id_pattern.search(admin) else admin for admin in os.environ.get('ADMIN', '').split()]
35+
36+
37+
# Rkn Developer
38+
# Don't Remove Credit 😔
39+
# Telegram Channel @RknDeveloper & @Rkn_Bots
40+
# Developer @RknDeveloperr

render.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
services:
2+
- type: web
3+
plan: free
4+
name: Rkn-AutoCaptionBot
5+
env: python
6+
buildCommand: pip install -r requirements.txt
7+
startCommand: python bot.py
8+
repo: https://github.com/RknDeveloper/Rkn-AutoCaptionBot.git
9+
branch: main
10+
autoDeploy: false
11+
envVars:
12+
- key: BOT_TOKEN
13+
sync: false
14+
- key: API_ID
15+
sync: false
16+
- key: API_HASH
17+
sync: false
18+
- key: FORCE_SUB
19+
sync: false
20+
- key: DB_NAME
21+
sync: false
22+
- key: DB_URL
23+
sync: false
24+
- key: START_PIC
25+
sync: false
26+
- key: ADMIN
27+
sync: false

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
motor
2+
pyrofork
3+
tgcrypto
4+
aiohttp
5+

runtime.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-3.10.8

0 commit comments

Comments
 (0)