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
+23
View File
@@ -0,0 +1,23 @@
from vkbottle.dispatch.rules import ABCRule
from vkbottle.user import Message
import json
class Permission(ABCRule[Message]):
def __init__(self):
self.trusted_ids = self.load_trusted_ids()
def load_trusted_ids(self):
try:
with open("./user_ids.json", "r") as json_file:
data = json.load(json_file)
return data
except FileNotFoundError:
# Если файл не существует, вернуть пустой список
return []
async def check(self, event: Message) -> bool:
return event.from_id in self.trusted_ids