mirror of
https://github.com/dizedev/vk_lp.git
synced 2026-09-17 02:48:52 +00:00
some updates
This commit is contained in:
+7
-8
@@ -1,4 +1,4 @@
|
||||
from sqlalchemy import (BigInteger, Column, Identity, Text)
|
||||
from sqlalchemy import (BigInteger, Column, Identity, Text, JSON, TIMESTAMP)
|
||||
from sqlalchemy.orm import DeclarativeBase
|
||||
|
||||
|
||||
@@ -22,10 +22,9 @@ class UsersProfile(Base):
|
||||
id = Column("id", BigInteger, Identity(start=1, increment=1, minvalue=1, cycle=False, cache=1), nullable=False,
|
||||
primary_key=True)
|
||||
vkid = Column("vkid", BigInteger, nullable=False, unique=True)
|
||||
# TODO: fill items below
|
||||
achievements = Column()
|
||||
trusted_ids = Column()
|
||||
prefix = Column()
|
||||
prefix_d = Column()
|
||||
prefix_delete = Column()
|
||||
last_login = Column()
|
||||
achievements = Column("achievements", JSON)
|
||||
trusted_ids = Column("trusted_ids", JSON)
|
||||
prefix = Column("prefix", Text)
|
||||
prefix_d = Column("prefix_d", Text)
|
||||
prefix_delete = Column("prefix_delete", Text)
|
||||
last_login = Column("last_login", TIMESTAMP)
|
||||
|
||||
+3
-13
@@ -2,9 +2,8 @@ import git
|
||||
import pytz
|
||||
from vkbottle.user import Message, UserLabeler
|
||||
|
||||
from config import user, edit_message, prefix_bot
|
||||
from config import edit_message, prefix_bot
|
||||
from custom_rules.permission import Permission
|
||||
from utils import rewards
|
||||
|
||||
bl = UserLabeler()
|
||||
|
||||
@@ -15,15 +14,6 @@ async def about_cmd(ctx: Message):
|
||||
version = repo.head.object.hexsha[:7]
|
||||
version_date = repo.head.object.committed_datetime.astimezone(pytz.timezone("Europe/Moscow"))
|
||||
|
||||
await edit_message(ctx,
|
||||
"Информация о боте 🤖:\n\n"
|
||||
"Название бота 🤖: dize_lp\n"
|
||||
f"Версия бота ⚙️: {version} от {version_date}\n"
|
||||
"Создатель бота 👨🦱: @dize_dev (Илдырым Денница)\n"
|
||||
f"Достижения🏆: {rewards['creator']}")
|
||||
# TODO: use Pillow to create img in real-time
|
||||
|
||||
await user.api.messages.send(
|
||||
peer_id=ctx.peer_id,
|
||||
random_id=0,
|
||||
attachment="photo-202995525_457239051"
|
||||
)
|
||||
await edit_message(ctx, attachment="photo-202995525_457239051")
|
||||
|
||||
+12
-4
@@ -1,6 +1,7 @@
|
||||
import git
|
||||
from vkbottle.user import Message, UserLabeler
|
||||
|
||||
import db.requests
|
||||
from config import edit_message, prefix_bot, prefix_dd
|
||||
from custom_rules.permission import Permission
|
||||
|
||||
@@ -8,13 +9,20 @@ bl = UserLabeler()
|
||||
|
||||
|
||||
@bl.message(Permission(), text=[prefix_bot + " профиль"])
|
||||
async def get_profile_cmd(message: Message):
|
||||
async def get_profile_cmd(ctx: Message):
|
||||
repo = git.Repo(search_parent_directories=True)
|
||||
version = repo.head.object.hexsha[:7]
|
||||
info = await db.requests.get_user_profile(user_id=ctx.from_id)
|
||||
|
||||
await edit_message(message,
|
||||
await edit_message(ctx,
|
||||
f"[ Impulse LP ]\n"
|
||||
f"Текущая версия: {version}\n"
|
||||
f"Основной префикс: {prefix_bot}\n"
|
||||
f"Префикс дд: {prefix_dd}"
|
||||
f"Основной префикс: {info.prefix}\n"
|
||||
f"Префикс дд: {info.prefix_delete}\n"
|
||||
f"{info.prefix_d}\n"
|
||||
f"\nДостижения\n"
|
||||
f"{info.achievements}\n"
|
||||
f"Последний вход на сайт: {info.last_login}\n"
|
||||
f"Довы:\n"
|
||||
f"{info.trusted_ids}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user