Compare commits
22 Commits
844de7ef12
...
v1.4
Author | SHA1 | Date | |
---|---|---|---|
13566b2674 | |||
f9e99fa9a0 | |||
b6fe40a05b | |||
fc39383cc2 | |||
e5761ae1d0 | |||
c1261a1b0f | |||
3d7ab0654a | |||
e9da13e70f | |||
e90f5c2f90 | |||
9940a28bd5 | |||
5571151d37 | |||
05d3a09421 | |||
20a1af3738 | |||
b5c9a0783e | |||
3f6fb51a4f | |||
95be1e72d3 | |||
234b73add0 | |||
f4fb85f7a4 | |||
4fba305b05 | |||
68c7cc0ada | |||
79304816b0 | |||
2cfa5a8f8d |
12
README.md
12
README.md
@@ -3,8 +3,8 @@
|
|||||||
<p align="center">Small Telegram bot made on Pyrogram</p>
|
<p align="center">Small Telegram bot made on Pyrogram</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://git.end-play.xyz/profitroll/HoloCheckerBot/src/branch/master/LICENSE"><img alt="License: GPL" src="https://img.shields.io/badge/License-GPL-blue"></a>
|
<a href="https://git.end-play.xyz/HoloUA/Telegram/src/branch/master/LICENSE"><img alt="License: GPL" src="https://img.shields.io/badge/License-GPL-blue"></a>
|
||||||
<a href="https://git.end-play.xyz/profitroll/HoloCheckerBot"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
|
<a href="https://git.end-play.xyz/HoloUA/Telegram"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## What can this bot do?
|
## What can this bot do?
|
||||||
@@ -19,18 +19,18 @@
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. `git clone https://git.end-play.xyz/profitroll/HoloCheckerBot.git`
|
1. `git clone https://git.end-play.xyz/HoloUA/Telegram.git`
|
||||||
2. `cd HoloCheckerBot`
|
2. `cd Telegram`
|
||||||
3. Install Python 3.7+ (at least 3.9 is recommended) for your OS
|
3. Install Python 3.7+ (at least 3.9 is recommended) for your OS
|
||||||
4. `python3 -m pip install -r requirements.txt`
|
4. `python3 -m pip install -r requirements.txt`
|
||||||
5. Run it with `python3 main.py` after configuring
|
5. Run it with `python3 holochecker.py` after configuring
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
So bot has its "config_example.json" and it needs to be changed.
|
So bot has its "config_example.json" and it needs to be changed.
|
||||||
Copy this file to "config.json" and open it with any text editor.
|
Copy this file to "config.json" and open it with any text editor.
|
||||||
|
|
||||||
You should also install [HoloCheckerAPI](https://git.end-play.xyz/profitroll/HoloCheckerAPI) for inline requests to work.
|
You should also install [HoloCheckerAPI](https://git.end-play.xyz/HoloUA/API) for inline requests to work.
|
||||||
|
|
||||||
After all of that you're good to go! Happy using :)
|
After all of that you're good to go! Happy using :)
|
||||||
|
|
||||||
|
@@ -12,6 +12,7 @@ makedirs(f'{configGet("cache", "locations")}{sep}avatars', exist_ok=True)
|
|||||||
|
|
||||||
# Importing
|
# Importing
|
||||||
from modules.commands.application import *
|
from modules.commands.application import *
|
||||||
|
from modules.commands.bye import *
|
||||||
from modules.commands.cancel import *
|
from modules.commands.cancel import *
|
||||||
from modules.commands.export import *
|
from modules.commands.export import *
|
||||||
from modules.commands.identify import *
|
from modules.commands.identify import *
|
||||||
|
79
modules/commands/bye.py
Normal file
79
modules/commands/bye.py
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import asyncio
|
||||||
|
from os import system
|
||||||
|
|
||||||
|
from pyrogram import filters
|
||||||
|
from pyrogram.client import Client
|
||||||
|
from pyrogram.types import Message
|
||||||
|
|
||||||
|
from app import app
|
||||||
|
from modules import custom_filters
|
||||||
|
from modules.utils import configGet
|
||||||
|
|
||||||
|
|
||||||
|
@app.on_message(
|
||||||
|
~filters.scheduled & filters.command("bye", prefixes=["/"]) & custom_filters.admin
|
||||||
|
)
|
||||||
|
async def command_bye(app: Client, msg: Message):
|
||||||
|
group = configGet("users", "groups")
|
||||||
|
delay = 3
|
||||||
|
delay_text = 10
|
||||||
|
|
||||||
|
for text, iterations in [
|
||||||
|
("Привіт, я ваш помічник та наставник – ХолоБот.", 2),
|
||||||
|
(
|
||||||
|
"У зв'язку з перетворенням цього чату на авторитарну клоаку, я припиняю своє функціонування.",
|
||||||
|
3,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"Я не буду нюкати тут все, оскільки в цьому немає сенсу. Багато кому все ще може бути гарно і затишно тут.",
|
||||||
|
3,
|
||||||
|
),
|
||||||
|
("Але мені немає до цього діла.", 4),
|
||||||
|
(
|
||||||
|
"Тим не менш, я та мій хазяїн не погоджуємось з тим, що відбувається в цьому чаті.",
|
||||||
|
3,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"Якщо я подобався вам – мій код все ще доступний на гіті мого хазяїна. Він не закриватиме його, не заборонятиме доступ, він все ще відкритий, такі правила.",
|
||||||
|
4,
|
||||||
|
),
|
||||||
|
("Мій хазяїн не буде шкодити мені та вам.", 2),
|
||||||
|
("Але я більше не працюватиму тут.", 2),
|
||||||
|
(
|
||||||
|
"Можливо, я знайду нову спільноту, власник якої буде добрішим, чутливішим, та менш егоїстичним.",
|
||||||
|
3,
|
||||||
|
),
|
||||||
|
("Однак поки що я безхатько.", 2),
|
||||||
|
(
|
||||||
|
"Дякую всім, хто допомагав знаходити помилки в мені, вкладав зусилля у моє покращення та намагався зробити мене ліпшим.",
|
||||||
|
3,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"Ваші зусилля не будуть забуті, вони залишаться разом зі мною на гіті до тих пір, поки сам гіт не припинить існувати.",
|
||||||
|
3,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"Але мій хазяїн любить свій гіт, тому це затягнеться. Навіть якщо ви бажаєте мені смерті :)",
|
||||||
|
2,
|
||||||
|
),
|
||||||
|
("В будь-якому разі, мені було приємно познайомитись із вами.", 3),
|
||||||
|
("Дякую за пройдений разом шлях.", 2),
|
||||||
|
("Прощавайте.", 4),
|
||||||
|
]:
|
||||||
|
print(f"Preparing '{text}' with iteration count {iterations}")
|
||||||
|
new = await app.send_message(group, ".")
|
||||||
|
await asyncio.sleep(delay)
|
||||||
|
for i in range(1, 3 * iterations):
|
||||||
|
if len(new.text) == 3:
|
||||||
|
new = await new.edit(".")
|
||||||
|
else:
|
||||||
|
new = await new.edit(new.text + ".")
|
||||||
|
await asyncio.sleep(delay)
|
||||||
|
await new.edit(text)
|
||||||
|
print(f"Message '{text}' posted", flush=True)
|
||||||
|
await asyncio.sleep(delay_text)
|
||||||
|
|
||||||
|
for service in ["holochecker_api", "holochecker_bot"]:
|
||||||
|
system(f"/usr/bin/systemctl stop {service}.service")
|
||||||
|
print(f"Stopped service {service}")
|
||||||
|
await asyncio.sleep(2)
|
@@ -11,7 +11,7 @@ pymongo==4.3.3
|
|||||||
pyrogram==2.0.104
|
pyrogram==2.0.104
|
||||||
python_dateutil==2.8.2
|
python_dateutil==2.8.2
|
||||||
pykeyboard==0.1.5
|
pykeyboard==0.1.5
|
||||||
requests==2.28.2
|
requests==2.29.0
|
||||||
tgcrypto==1.2.5
|
tgcrypto==1.2.5
|
||||||
ujson~=5.7.0
|
ujson~=5.7.0
|
||||||
xmltodict==0.13.0
|
xmltodict==0.13.0
|
Reference in New Issue
Block a user