A_dict = {
    "🔴🔴":"あ","🔴🔵":"け","🔴🟡":"し","🔴🟢":"ぞ","🔴🟠":"づ","🔴🟣":"の","🔴⚪️":"ぶ","🔴⚫️":"ま","🔴🟤":"ら",
    "🔵🔴":"い","🔵🔵":"こ","🔵🟡":"す","🔵🟢":"た","🔵🟠":"っ","🔵🟣":"は","🔵⚪️":"べ","🔵⚫️":"み","🔵🟤":"り",
    "🟡🔴":"う","🟡🔵":"が","🟡🟡":"せ","🟡🟢":"ち","🟡🟠":"で","🟡🟣":"ひ","🟡⚪️":"ぼ","🟡⚫️":"む","🟡🟤":"る",
    "🟢🔴":"え","🟢🔵":"ぎ","🟢🟡":"そ","🟢🟢":"つ","🟢🟠":"ど","🟢🟣":"ふ","🟢⚪️":"ぱ","🟢⚫️":"め","🟢🟤":"れ",
    "🟠🔴":"お","🟠🔵":"ぐ","🟠🟡":"ざ","🟠🟢":"て","🟠🟠":"な","🟠🟣":"ヘ","🟠⚪️":"ぴ","🟠⚫️":"も","🟠🟤":"ろ",
    "🟣🔴":"か","🟣🔵":"げ","🟣🟡":"じ","🟣🟢":"と","🟣🟠":"に","🟣🟣":"ほ","🟣⚪️":"ぷ","🟣⚫️":"や","🟣🟤":"、",
    "⚪️🔴":"き","⚪️🔵":"ご","⚪️🟡":"ず","⚪️🟢":"だ","⚪️🟠":"ぬ","⚪️🟣":"ば","⚪️⚪️":"ぺ","⚪️⚫️":"ゆ","⚪️🟤":"。",
    "⚫️🔴":"く","⚫️🔵":"さ","⚫️🟡":"ぜ","⚫️🟢":"ぢ","⚫️🟠":"ね","⚫️🟣":"び","⚫️⚪️":"ぽ","⚫️⚫️":"よ","⚫️🟤":"ゎ",
    "🟤🔴":"わ","🟤🔵":"ゐ","🟤🟡":"ゑ","🟤🟢":"を","🟤🟠":"ん","🟤🟣":"ゃ","🟤⚪️":"ゅ","🟤⚫️":"ょ","🟤🟤":"ー",
}#「辞書」
B_dict = {v: k for k, v in A_dict.items()}#「KV入れ替えで変換作成」

def decode(code):#「T→S」
    parts = code.split()#リスト化
    return ''.join(A_dict.get(p, '?') for p in parts)#「forで繰り返すcodeの変換作業」

def encode(text):#「T←S」
    return ' '.join(B_dict.get(ch, '??') for ch in text)#「forで繰り返すtextの変換作業」

def S(D):
    print(f'{encode(D)}')
    print("----------------------")

def k(j):
    print(f'ほんやく:{decode(j)}')
    print("======================")

def auto(text):
    if "🔴" in text or "🔵" in text or "🟡" in text or "🟢" in text or "🟠" in text or "🟣" in text or "⚪️" in text or "⚫️" in text or "🟤" in text:
        k(text)
    else:
        S(text)

auto('なりたありさ。かねほしさに、ごうとうをしまくり、わずかいちにちでじゅうにんをさつがい')
auto('🟠🟠 🔵🟤 🔵🟢 🔴🔴 🔵🟤 ⚫️🔵 ⚪️🟤 🟣🔴 ⚫️🟠 🟣🟣 🔴🟡 ⚫️🔵 🟣🟠 🟣🟤 ⚪️🔵 🟡🔴 🟣🟢 🟡🔴 🟤🟢 🔴🟡 🔴⚫️ ⚫️🔴 🔵🟤 🟣🟤 🟤🔴 ⚪️🟡 🟣🔴 🔵🔴 🟡🟢 🟣🟠 🟡🟢 🟡🟠 🟣🟡 🟤⚪️ 🟡🔴 🟣🟠 🟤🟠 🟤🟢 ⚫️🔵 🟢🟢 🟡🔵 🔵🔴')

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: