add image hash field

This commit is contained in:
bakatrouble 2022-08-08 04:10:41 +03:00
parent bdfd452e06
commit bbd0b635ef
4 changed files with 566 additions and 450 deletions

View File

@ -41,6 +41,7 @@ boto3 = "*"
filetype = "*"
qrtools = "*"
vkwave = "*"
imagehash = "*"
[dev-packages]

996
Pipfile.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
# Generated by Django 4.1 on 2022-08-08 01:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bots", "0006_queueditem_message_id"),
]
operations = [
migrations.AddField(
model_name="queueditem",
name="image_hash",
field=models.CharField(blank=True, max_length=64, null=True),
),
]

View File

@ -151,6 +151,7 @@ class QueuedItem(models.Model):
type = models.CharField(max_length=12)
args = models.TextField()
message_id = models.PositiveBigIntegerField(default=None, db_index=True, null=True, blank=True)
image_hash = models.CharField(max_length=64, null=True, blank=True)
def send(self, bot: Bot):
getattr(bot, 'send_' + self.type)(self.config.chat_id, *json.loads(self.args))