Compare commits

...

2 commits

Author SHA1 Message Date
cbddda9a76 Update repo for fixed issue 2022-07-30 17:30:07 +02:00
1ffa300741 Add height parameter to emojis
To support upcoming inline images in Element Android, and potentially
some other clients. This retains the custom size for emojis (on clients
that already supported it), but fixes it on clients that handle scaling
exclusively though the height and width of the img element (such as
SchildiChat and the upcoming Element Android inline images).
2022-07-28 01:05:52 +02:00
2 changed files with 1 additions and 4 deletions

View file

@ -38,8 +38,5 @@ By default, the bot's session is not verified. Verification is required to view
### Messages sent by selfbot
Any messages sent by this selfbot, like responses to commands, will include `(SelfBot)` (and if linked, the source code) at the end of the message. This is to help room moderators quickly identify why exactly a user account is responding automatically, and will hopefully give the user running the selfbot a chance to disable it in a specific room before being removed by moderators. This does not affect edited messages.
### Broken features
Using a feature of the bot that edits your message, like custom emojis, replacement text, or !shrug, while replying to another message, duplicates the reply in the edit.
### Support room
The support room can be found [here](https://matrix.to/#/#deadcade-selfbot:deadca.de). It is recommended to keep testing in this room or another private room, as it is unencrypted and does not clutter other rooms.

View file

@ -355,7 +355,7 @@ async def message_callback(room: nio.MatrixRoom, event: nio.RoomMessageText) ->
with open(settings["emojis_path"], "w") as f:
json.dump(emojis, f)
# Replace the emoij with the respective file
new_body = new_body.replace(":" + emoji + ":" + ("" if not sizeset else f"{size}:"), f"<img src=\"{emojis[size][emoji]}\" alt=\"{emoji}\">", 1)
new_body = new_body.replace(":" + emoji + ":" + ("" if not sizeset else f"{size}:"), f"<img height=\"{size}\" src=\"{emojis[size][emoji]}\" alt=\"{emoji}\">", 1)
# Text replace processor
if event.body.count(";") > 1:
for to_replace in text_replace.keys():