More work on Matrix, move commands to new HTML locales, fix Mastodon

This commit is contained in:
2024-06-28 01:57:42 +02:00
parent 2c73846554
commit 4afb5f3275
28 changed files with 307 additions and 271 deletions

14
ModWinDog/Multifun/Multifun.py Normal file → Executable file
View File

@ -4,19 +4,19 @@
# ==================================== #
def mMultifun(context:EventContext, data:InputMessageData) -> None:
cmdkey = data.Name
cmdkey = data.command.name
replyToId = None
if data.Quoted:
replyFromUid = data.Quoted.User.Id
if data.quoted:
replyFromUid = data.quoted.user.id
# TODO work on all platforms for the bot id
if replyFromUid.split(':')[1] == TelegramToken.split(':')[0] and 'bot' in Locale.__(cmdkey):
Text = choice(Locale.__(f'{cmdkey}.bot'))
elif replyFromUid == data.User.Id and 'self' in Locale.__(cmdkey):
Text = choice(Locale.__(f'{cmdkey}.self')).format(data.User.Name)
elif replyFromUid == data.user.id and 'self' in Locale.__(cmdkey):
Text = choice(Locale.__(f'{cmdkey}.self')).format(data.user.name)
else:
if 'others' in Locale.__(cmdkey):
Text = choice(Locale.__(f'{cmdkey}.others')).format(data.User.Name, data.Quoted.User.Name)
replyToId = data.Quoted.messageId
Text = choice(Locale.__(f'{cmdkey}.others')).format(data.user.name, data.quoted.user.name)
replyToId = data.quoted.message_id
else:
if 'empty' in Locale.__(cmdkey):
Text = choice(Locale.__(f'{cmdkey}.empty'))