mirror of
https://gitlab.com/octospacc/WinDog.git
synced 2025-06-05 22:09:20 +02:00
More work on Matrix, move commands to new HTML locales, fix Mastodon
This commit is contained in:
@@ -11,13 +11,10 @@ def cHash(context:EventContext, data:InputMessageData):
|
||||
if not (text_input and (algorithm in hashlib.algorithms_available)):
|
||||
return SendMessage(context, {"Text": choice(Locale.__('hash.usage')).format(data.command.tokens[0], hashlib.algorithms_available)})
|
||||
hashed = hashlib.new(algorithm, text_input.encode()).hexdigest()
|
||||
return SendMessage(context, {
|
||||
"TextPlain": hashed,
|
||||
"TextMarkdown": MarkdownCode(hashed, True),
|
||||
})
|
||||
return SendMessage(context, OutputMessageData(text_plain=hashed, text_html=f"<pre>{hashed}</pre>"))
|
||||
|
||||
RegisterModule(name="Hashing", group="Geek", summary="Functions for hashing of textual content.", endpoints=[
|
||||
SafeNamespace(names=["hash"], summary="Responds with the hash-sum of a message received.", handler=cHash, arguments={
|
||||
RegisterModule(name="Hashing", group="Geek", endpoints=[
|
||||
SafeNamespace(names=["hash"], handler=cHash, arguments={
|
||||
"algorithm": True,
|
||||
}),
|
||||
])
|
||||
|
21
ModWinDog/Hashing/Hashing.yaml
Normal file → Executable file
21
ModWinDog/Hashing/Hashing.yaml
Normal file → Executable file
@@ -1,14 +1,15 @@
|
||||
summary:
|
||||
en: Functions for calculating hashes of content.
|
||||
it: Funzioni per calcolare hash di contenuti.
|
||||
hash:
|
||||
summary:
|
||||
en: Responds with the hash-sum of the received message.
|
||||
arguments:
|
||||
algorithm:
|
||||
en: Algorithm
|
||||
it: Algoritmo
|
||||
body:
|
||||
en: Text to hash
|
||||
it: Testo da hashare
|
||||
endpoints:
|
||||
hash:
|
||||
summary:
|
||||
en: Responds with the hash-sum of the received message.
|
||||
arguments:
|
||||
algorithm:
|
||||
en: Algorithm
|
||||
it: Algoritmo
|
||||
body:
|
||||
en: Text to hash
|
||||
it: Testo da hashare
|
||||
|
||||
|
Reference in New Issue
Block a user