-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use editMessageMedia
to keep daily announcements updated
#111
Comments
(After a power outage just for fun…) Calling
So this would be a one-way process: If the record for a message that didn't include any image when sent is changed so that the message would have included an image if it were sent now, we can go ahead and add the image. That's it 🙁. |
I think I need to record the current [source] image in I already kinda half-assed #97 (comment): metabot/metabot/modules/reminders.py Lines 102 to 106 in b570d46
without getting the futureproofing I actually wanted: metabot/metabot/modules/reminders.py Lines 33 to 36 in b570d46
so I'd need to do something like: if botuser != 'alerts' and len(record) == 3:
records[key] += ('', '')
if botuser != 'alerts' and len(record) == 5:
records[key] += ('',) or: if botuser != 'alerts':
while len(record) < 6:
records[key] += ('',) Holy crap! >>> class MyDict(dict):
... pass
...
>>> class Announcement:
... a = 1
...
>>> mydict = MyDict()
>>> mydict['a'] = 2
>>> ann = Announcement()
>>> ann.a
1
>>> ann.__dict__ = mydict
>>> ann.a
2
>>> type(ann.__dict__)
<class '__main__.MyDict'>
>>> ann.a = 3
>>> mydict
{'a': 3} I thought surely, even if it let me assign |
https://core.telegram.org/bots/api#october-31-2024:
editMessageText
to change the text, or do you have to useeditMessageCaption
after adding an image?sendMessage(text='a' * 2000)
, theneditMessageMedia
to add a picture, does it fail, does it change to a message withcaption='a' * 2000
, does it change to a message withcaption='a' * 1024
, or what?caption='a' * 2000
, can youeditMessageCaption(caption='b' * 2000)
? Can you edit it at all, or is it stuck? Can you remove the image, edit the text, then readd the image?Depending on how this turns out, I'd like to start sending all announcements as text messages, immediately editing them to add media (if appropriate), and also keeping media updated (including removing it) as event titles/etc. change.
The text was updated successfully, but these errors were encountered: