mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2026-04-26 11:55:48 +00:00
统一格式(无实质改动) & 添加了图片 (#23)
* 修复了style和script标签无法去除的问题 * 添加了图片展示 & 统一了引号格式 * 添加了图片展示 & 统一了引号格式 * 统一引号格式并异步处理函数
This commit is contained in:
@@ -1,37 +1,37 @@
|
||||
# MorseCode
|
||||
MorseEncode = {
|
||||
'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.',
|
||||
'G': '--.', 'H': '....', 'I': '..', 'J': '.---', 'K': '-.-', 'L': '.-..',
|
||||
'M': '--', 'N': '-.', 'O': '---', 'P': '.--.', 'Q': '--.-', 'R': '.-.',
|
||||
'S': '...', 'T': '-', 'U': '..-', 'V': '...-', 'W': '.--', 'X': '-..-',
|
||||
'Y': '-.--', 'Z': '--..',
|
||||
'1': '.----', '2': '..---', '3': '...--', '4': '....-', '5': '.....',
|
||||
'6': '-....', '7': '--...', '8': '---..', '9': '----.', '0': '-----',
|
||||
'.': '.-.-.-', ':': '---...', ',': '--..--', ';': '-.-.-.',
|
||||
'?': '..--..', '=': '-...-', '\'': '.----.', '/': '-..-.',
|
||||
'!': '-.-.--', '-': '-....-', '_': '..--.-', '\"': '.-..-.',
|
||||
'(': '-.--.', ')': '-.--.-', '$': '...-..-', '&': '....',
|
||||
'@': '.--.-.', ' ': ' '
|
||||
"A": ".-", "B": "-...", "C": "-.-.", "D": "-..", "E": ".", "F": "..-.",
|
||||
"G": "--.", "H": "....", "I": "..", "J": ".---", "K": "-.-", "L": ".-..",
|
||||
"M": "--", "N": "-.", "O": "---", "P": ".--.", "Q": "--.-", "R": ".-.",
|
||||
"S": "...", "T": "-", "U": "..-", "V": "...-", "W": ".--", "X": "-..-",
|
||||
"Y": "-.--", "Z": "--..",
|
||||
"1": ".----", "2": "..---", "3": "...--", "4": "....-", "5": ".....",
|
||||
"6": "-....", "7": "--...", "8": "---..", "9": "----.", "0": "-----",
|
||||
".": ".-.-.-", ":": "---...", ",": "--..--", ";": "-.-.-.",
|
||||
"?": "..--..", "=": "-...-", "\'": ".----.", "/": "-..-.",
|
||||
"!": "-.-.--", "-": "-....-", "_": "..--.-", "\"": ".-..-.",
|
||||
"(": "-.--.", ")": "-.--.-", "$": "...-..-", "&": "....",
|
||||
"@": ".--.-.", " ": " "
|
||||
}
|
||||
MorseDecode = {value: key for key, value in MorseEncode.items()}
|
||||
|
||||
|
||||
# MorseCode Encrypt
|
||||
def morse_encrypt(msg: str):
|
||||
async def morse_encrypt(msg: str):
|
||||
result = ""
|
||||
msg = msg.upper()
|
||||
for char in msg:
|
||||
if char in MorseEncode:
|
||||
result += MorseEncode[char]
|
||||
else:
|
||||
result += '..--..'
|
||||
result += ' '
|
||||
result += "..--.."
|
||||
result += " "
|
||||
|
||||
return result
|
||||
|
||||
|
||||
# MorseCode Decrypt
|
||||
def morse_decrypt(msg: str):
|
||||
async def morse_decrypt(msg: str):
|
||||
result = ""
|
||||
|
||||
msg_arr = msg.split()
|
||||
@@ -39,6 +39,6 @@ def morse_decrypt(msg: str):
|
||||
if char in MorseDecode:
|
||||
result += MorseDecode[char]
|
||||
else:
|
||||
result += '?'
|
||||
result += "?"
|
||||
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user