This commit is contained in:
dize_dev
2023-10-29 23:01:17 +06:00
commit f43aee3e57
15 changed files with 248 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
from . import game_handler, deletedmsg, info_bot
labelers = [game_handler.bl, deletedmsg.bl, info_bot.bl]
+48
View File
@@ -0,0 +1,48 @@
import datetime
from custom_rules.permission import Permission
from vkbottle.user import Message
from config import bl, user
DD_SCRIPT = (
'var i = 0;var msg_ids = [];var count = %d;'
'var items = API.messages.getHistory({"peer_id":%d,"count":"200", "offset":"0"}).items;'
'while (count > 0 && i < items.length) {if (items[i].out == 1) {if (items[i].id == %d) {'
'if (items[i].reply_message) {msg_ids.push(items[i].id);msg_ids.push(items[i].reply_message.id);'
'count = 0;};if (items[i].fwd_messages) {msg_ids.push(items[i].id);var j = 0;while (j < '
'items[i].fwd_messages.length) {msg_ids.push(items[i].fwd_messages[j].id);j = j + 1;};count = 0;};};'
'msg_ids.push(items[i].id);count = count - 1;};if ((%d - items[i].date) > 86400) {count = 0;};i = i + 1;};'
'API.messages.delete({"message_ids": msg_ids});return count;'
)
prefix = "дд"
@bl.message(
Permission(),
text=[prefix + " <count:int>"],
)
async def dd_handler(message: Message, count: int = 2):
await user.api.execute(
DD_SCRIPT % (
count,
message.peer_id,
message.from_id,
int(datetime.datetime.now().timestamp())
)
)
@bl.message(
Permission(),
text=["все", "всё"],
)
async def dd_all_handler(message: Message):
count = 1000
await user.api.execute(
DD_SCRIPT % (
count,
message.peer_id,
message.from_id,
int(datetime.datetime.now().timestamp())
)
)
+85
View File
@@ -0,0 +1,85 @@
import asyncio
from vkbottle.user import Message
from config import bl, edit_message
from custom_rules.permission import Permission
@bl.message(Permission(), text="игра")
async def game(message: Message):
loader = (
'⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜',
"""
⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
""",
"""
⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
""",
"""
⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬛⬛⬛✊✊⬛⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬜⬛✊✊⬛✊✊⬛✊✊⬛⬛⬛⬜
⬜⬜⬜⬜⬛✊✊⬛✊✊⬛✊✊⬛✊✊⬛
⬜⬛⬜⬜⬛✊✊⬛✊✊⬛✊✊⬛✊✊⬛
""",
"""
⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬛⬛⬛✊✊⬛⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬜⬛✊✊⬛✊✊⬛✊✊⬛⬛⬛⬜
⬜⬜⬜⬜⬛✊✊⬛✊✊⬛✊✊⬛✊✊⬛
⬜⬛⬜⬜⬛✊✊⬛✊✊⬛✊✊⬛✊✊⬛
⬛✊⬛⬜⬛✊✊✊✊✊✊✊✊✊✊✊⬛
⬛✊✊⬛⬛✊✊✊✊✊✊✊✊✊✊✊⬛
⬜⬛✊✊✊✊✊✊✊✊✊✊✊✊✊✊⬛
⬜⬜⬛✊✊✊✊✊✊✊✊✊✊✊✊✊⬛
⬜⬜⬜⬛✊✊✊✊✊✊✊✊✊✊✊✊⬛
""",
"""
⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬛✊✊⬛⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬛⬛⬛✊✊⬛⬛⬛⬜⬜⬜⬜
⬜⬜⬜⬜⬛✊✊⬛✊✊⬛✊✊⬛⬛⬛⬜
⬜⬜⬜⬜⬛✊✊⬛✊✊⬛✊✊⬛✊✊⬛
⬜⬛⬜⬜⬛✊✊⬛✊✊⬛✊✊⬛✊✊⬛
⬛✊⬛⬜⬛✊✊✊✊✊✊✊✊✊✊✊⬛
⬛✊✊⬛⬛✊✊✊✊✊✊✊✊✊✊✊⬛
⬜⬛✊✊✊✊✊✊✊✊✊✊✊✊✊✊⬛
⬜⬜⬛✊✊✊✊✊✊✊✊✊✊✊✊✊⬛
⬜⬜⬜⬛✊✊✊✊✊✊✊✊✊✊✊✊⬛
⬜⬜⬜⬜⬛✊✊✊✊✊✊✊✊✊✊✊⬛
⬜⬜⬜⬜⬛✊✊✊✊✊✊✊✊✊✊✊⬛
⬜⬜⬜⬜⬜⬛✊✊✊✊✊✊✊✊✊⬛⬜
⬜⬜⬜⬜⬜⬜⬛⬛⬛⬛⬛⬛⬛⬛⬛⬜⬜
""",
)
for new_text in loader:
await edit_message(
message,
new_text
)
await asyncio.sleep(1)
+11
View File
@@ -0,0 +1,11 @@
from custom_rules.permission import Permission
from vkbottle.user import Message
from config import bl, edit_message
@bl.message(Permission(), text="хелло")
async def hello(message: Message):
await edit_message(
message,
"привет"
)
View File