This commit is contained in:
2021-03-11 23:43:54 +03:00
parent 22bce5b147
commit a86ddf61bf
35 changed files with 1129 additions and 801 deletions

View File

@@ -1,5 +1,4 @@
from django.db import models
from jsonfield import JSONField
from telegram import Update
from telegram.error import BadRequest
from telegram.ext import Dispatcher, CallbackContext, CommandHandler
@@ -11,7 +10,7 @@ from bots.models import TelegramBotModuleConfig
class PingBotCategory(models.Model):
chat_id = models.BigIntegerField(db_index=True)
cat_name = models.CharField(max_length=64, db_index=True)
user_ids = JSONField(null=True)
user_ids = models.JSONField(null=True)
def add_user(self, uid: int):
user_ids = set(self.user_ids or [])