add image hash field
This commit is contained in:
parent
bdfd452e06
commit
bbd0b635ef
1
Pipfile
1
Pipfile
@ -41,6 +41,7 @@ boto3 = "*"
|
|||||||
filetype = "*"
|
filetype = "*"
|
||||||
qrtools = "*"
|
qrtools = "*"
|
||||||
vkwave = "*"
|
vkwave = "*"
|
||||||
|
imagehash = "*"
|
||||||
|
|
||||||
[dev-packages]
|
[dev-packages]
|
||||||
|
|
||||||
|
996
Pipfile.lock
generated
996
Pipfile.lock
generated
File diff suppressed because it is too large
Load Diff
18
bots/migrations/0007_queueditem_image_hash.py
Normal file
18
bots/migrations/0007_queueditem_image_hash.py
Normal 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),
|
||||||
|
),
|
||||||
|
]
|
@ -151,6 +151,7 @@ class QueuedItem(models.Model):
|
|||||||
type = models.CharField(max_length=12)
|
type = models.CharField(max_length=12)
|
||||||
args = models.TextField()
|
args = models.TextField()
|
||||||
message_id = models.PositiveBigIntegerField(default=None, db_index=True, null=True, blank=True)
|
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):
|
def send(self, bot: Bot):
|
||||||
getattr(bot, 'send_' + self.type)(self.config.chat_id, *json.loads(self.args))
|
getattr(bot, 'send_' + self.type)(self.config.chat_id, *json.loads(self.args))
|
||||||
|
Loading…
Reference in New Issue
Block a user