Home
toki pona

Ceiltíoch

Ceiltíoch (Irish for "Celticist") is a bot for converting Celticist phonemic transcription to phonemic IPA transcriptions in the 3 main dialects of Irish.


Source code

# Work with Python 3.6
import discord, random, sys
from AnTeangaBheo import chapters, headings
TOKEN = '[REDACTED]'

channelId = '0'

general_help = '```\
Ceiltíoch (Irish for "Celticist") is a bot for converting Celticist phonemic transcription to phonemic IPA transcriptions in the 3 main dialects of Irish.\n\
\n\
Commands:\n\
____________________\n\
c!haigh\t\t\t\t\t   Pings bot.\n\
c!help\t\t\t\t\t\tShows this help.\n\
c!help u|c|m\t\t\t\t  Shows transcription scheme for\n\
\t\t\t\t\t\t\t  Ulster/Connacht/Munster Irish respectively.\n\
c!help g\t\t\t\t\t  Shows help for the Gaelic script converter.\n\
\n\
u//\t\t\tConverts Celticist to IPA for Ulster Irish.\n\
c//\t\t\tConverts Celticist to IPA for Connacht Irish.\n\
m//\t\t\tConverts Celticist to IPA for Munster Irish.\n\
\n\
g//\t\t\t Converts Latin script to pseudo-Gaelic script.\n\
\n\
c!mts\t\t\t\t\t     Responds with a random Máirtín Tom Sheáinín\n\
\t\t\t\t\t\t\t  phrase.\n\
```'

ulster_help = "```\
Usage: u//\n\
\n\
Ulster Irish Celticist → IPA key\n\
____________________\n\
Vowels:\n\
Celticist: a e i o u @ a: e: i: o: u: ai au i@ u@\n\
IPA:       a ɛ ɪ ʌ ɤ ə æː eː iː ɔː ʉː ai oː ia ua\n\
\n\
Broad consonants:\n\
Celticist: b  d  f  g  G  k  l  L  m  n  N  ŋ  p  r  R  s  t  v  x\n\
IPA:       bˠ d̪ˠ fˠ ɡ  ɣ  k  lˠ l̪ˠ mˠ nˠ n̪ˠ ŋ  pˠ ɾˠ ɾˠ sˠ t̪ˠ w  x\n\
\n\
Slender consonants:\n\
Celticist: b' d' f' g' G' k' l' L' m' n' N' ŋ' p' r' R' s' t' v' x'\n\
IPA:       bʲ ʥ  fʲ ɟ  j  c  lʲ l̠ʲ mʲ nʲ n̠ʲ ɲ  pʲ ɾʲ ɾˠ ɕ  ʨ  vʲ ç\n\
\n\
Other consonants:\n\
Celticist: h\n\
IPA:       h\n\
```"
connacht_help = "```\
Usage: c//\n\
\n\
Connacht Irish Celticist → IPA key\n\
____________________\n\
Vowels:\n\
Celticist: a e i o u @ a: e: i: o: u: ai au i@ u@\n\
IPA:       a ɛ ɪ ʌ ʊ ə ɑː eː iː oː uː ai au iə uə\n\
\n\
Broad consonants:\n\
Celticist: b  d  f  g  G  k  l  L  m  n  N  ŋ  p  r  R  s  t  v  x\n\
IPA:       bˠ d̪ˠ fˠ ɡ  ɣ  k  lˠ l̪ˠ mˠ nˠ n̪ˠ ŋ  pˠ ɾˠ ɾˠ sˠ t̪ˠ w  x\n\
\n\
Slender consonants:\n\
Celticist: b' d' f' g' G' k' l' L' m' n' N' ŋ' p' r' R' s' t' v' x'\n\
IPA:       bʲ d̠ʲ fʲ ɟ  ʝ  c  lʲ l̠ʲ mʲ nʲ n̠ʲ ɲ  pʲ ɾʲ ɾˠ ɕ  t̠ʲ vʲ ç\n\
\n\
Other consonants:\n\
Celticist: h\n\
IPA:       h\n\
```"
munster_help = "```\
Usage: m//\n\
\n\
Munster Irish Celticist → IPA key\n\
____________________\n\
Vowels:\n\
Celticist: a e i o u @ a: e: i: o: u: ai au i@ u@\n\
IPA:       a ɛ ɪ ʌ ʊ ə ɑː eː iː oː uː ai ɔu iə uə\n\
\n\
Broad consonants:\n\
Celticist: b  d  f  g  G  k  l  L  m  n  N  ŋ  p  r  R  s  t  v  x\n\
IPA:       bˠ d̪ˠ fˠ ɡ  ɣ  k  lˠ l̪ˠ mˠ nˠ n̪ˠ ŋ  pˠ ɾˠ ɾˠ sˠ t̪ˠ vˠ x\n\
\n\
Slender consonants:\n\
Celticist: b' d' f' g' G' k' l' L' m' n' N' ŋ' p' r' R' s' t' v' x'\n\
IPA:       bʲ dʲ fʲ ɟ  ʝ  c  lʲ l̠ʲ mʲ nʲ n̠ʲ ɲ  pʲ ɾʲ ɾˠ ʃ  tʲ vʲ ç\n\
\n\
Other consonants:\n\
Celticist: h\n\
IPA:       h\n\
```"
gaelic_help = '```\
Usage: g//\n\
\n\
Latin→Pseudo-Gaelic script converter\n\
____________________\n\
This converter turns regular latin script Irish ("Gaeilge") into\n\
pseudo-Gaelic script approximated by Unicode characters ("Ᵹⲁeıᒐᵹe").\n\
____________________\n\
Regular usage:\n\
\n\
Regular consonants, vowels and punctuation are typed as normal.\n\
e.g. g/t/ → ꞇ\n\
\n\
Dotted consonants are produced with consonant+h.\n\
e.g. g/bh/ → б̇\n\
\n\
Acute accents are produced using either your regular keyboard (á)\n\
or by typing a tilde "~" after the vowel.\n\
e.g. g/a~/ → ⲁ\u0301\n\
\n\
Grave accents are produced using either your regular keyboard (à)\n\
or by typing a vertical bar "|" after the vowel.\n\
e.g. g/a|/ → ⲁ\u0300\n\
\n\
Tironian et (⁊) is produced by typing an ampersand (&).\n\
____________________\n\
Scribal abbreviations:\n\
\n\
Overdot: g/a#./ → ⲁ\u0307\n\
Suspension stroke: g/a#-/ → ⲁ\u0305\n\
M stroke: g/a#-/ → ⲁ\u0303\n\
\n\
"con" abbreviation g/#c/ → ↄ\n\
```'

ulsterPhonology = ["a","ɛ","ɪ","ʌ","ɤ","ə","æː","eː","iː","ɔː","ʉː","ai","oː","ia","ua",\
     "bˠ","d̪ˠ","fˠ","ɡ","ɣ","k","lˠ","l̪ˠ","mˠ","nˠ","n̪ˠ","ŋ","pˠ","ɾˠ","ɾˠ","sˠ","t̪ˠ","w","x",\
     "bʲ","ʥ","fʲ","ɟ","j","c","lʲ","l̠ʲ","mʲ","nʲ","n̠ʲ","ɲ","pʲ","ɾʲ","ɾˠ","ɕ","ʨ","vʲ","ç",\
     "h"]
connachtPhonology = ["a","ɛ","ɪ","ʌ","ʊ","ə","ɑː","eː","iː","oː","uː","ai","au","iə","uə",\
     "bˠ","d̪ˠ","fˠ","ɡ","ɣ","k","lˠ","l̪ˠ","mˠ","nˠ","n̪ˠ","ŋ","pˠ","ɾˠ","ɾˠ","sˠ","t̪ˠ","w","x",\
     "bʲ","d̠ʲ","fʲ","ɟ","ʝ","c","lʲ","l̠ʲ","mʲ","nʲ","n̠ʲ","ɲ","pʲ","ɾʲ","ɾˠ","ɕ","t̠ʲ","vʲ","ç",\
     "h"]
munsterPhonology = ["a","ɛ","ɪ","ʌ","ʊ","ə","ɑː","eː","iː","oː","uː","ai","ɔu","iə","uə",\
     "bˠ","d̪ˠ","fˠ","ɡ","ɣ","k","lˠ","l̪ˠ","mˠ","nˠ","n̪ˠ","ŋ","pˠ","ɾˠ","ɾˠ","sˠ","t̪ˠ","vˠ","x",\
     "bʲ","dʲ","fʲ","ɟ","ʝ","c","lʲ","l̠ʲ","mʲ","nʲ","n̠ʲ","ɲ","pʲ","ɾʲ","ɾˠ","ʃ","tʲ","vʲ","ç",\
     "h"]

def phrase():
    choice = random.randint(1,11)
    if choice==1:
        chosenphrase = "sea"
    elif choice==2:
        chosenphrase = "by dad"
    elif choice==3:
        chosenphrase = "ab ea"
    elif choice==4:
        chosenphrase = "muis ab ea"
    elif choice==5:
        chosenphrase = "hahhh"
    elif choice==6:
        chosenphrase = "tá's am"
    elif choice==7:
        chosenphrase = "bail ó dhia ort"
    elif choice==8:
        chosenphrase = "mar sin é"
    elif choice==9:
        chosenphrase = "mmm"
    elif choice==10:
        chosenphrase = "bhoil má tá"
    elif choice==11:
        chosenphrase = "muis má tá"
    return chosenphrase

client = discord.Client()

@client.event


async def on_message(message):

    # we do not want the bot to reply to itself
    if message.author == client.user:
        return
    start = message.content.find("c!haigh")>-1
        
    #ping
    if message.content.find("c!haigh")>-1:
        msg = 'Haigh a {0.author.mention}'.format(message)
        await client.send_message(message.channel, msg)
    
    elif message.content.find("c!help")>-1: 
        #ulster transcription guide
        if message.content.find("c!help u")>-1:
            msg = ulster_help.format(message)
            await client.send_message(message.channel, msg)
        #connacht transcription guide
        elif message.content.find("c!help c")>-1:
            msg = connacht_help.format(message)
            await client.send_message(message.channel, msg)
        #munster transcription guide
        elif message.content.find("c!help m")>-1:
            msg = munster_help.format(message)
            await client.send_message(message.channel, msg)
        #pseudo-gaelic script guide
        elif message.content.find("c!help g")>-1:
            msg = gaelic_help.format(message)
            await client.send_message(message.channel, msg)
        #main help
        else:
            msg = general_help.format(message)
            await client.send_message(message.channel, msg)
            
    #conamara 100
    elif message.content.lower().find("by dad muis anois má tá")>-1:
        firstphrase = phrase()
        extraphrases = " "+firstphrase[0].upper()+firstphrase[1:]
        for i in range(random.randint(1,3)):
            newphrase = phrase()
            while (firstphrase.find(newphrase)>-1 or extraphrases.find(newphrase)>-1):
                newphrase = phrase()
                
            extraphrases+=" "+newphrase
            
        msg = ":fire: :ok_hand: :flag_ie: ***Conⲁmⲁꞃⲁ*** :100: :flag_ie: :ok_hand: :fire: \n"+extraphrases+".".format(message)
        await client.send_message(message.channel, msg)
 
    #mts
    elif message.content.find("c!mts")>-1 or message.content.lower().find("máirtín")>-1\
    or message.content.lower().find("mháirtín")>-1 or message.content.lower().find("by dad")>-1 or message.content.lower().find("by deaid")>-1\
    or message.content.lower().find("baidh dad")>-1 or message.content.lower().find("baidh deaid")>-1:

        msg = phrase().format(message)
            
        await client.send_message(message.channel, msg)

    elif message.content.lower().find("c!seafóid")>-1 or message.content.lower().find("c!seafoid")>-1:
        numberofsentences = random.randint(10,20)
        paragraph = ""
        for j in range(numberofsentences):
            phrases = phrase()
            phrases = phrases[0].upper()+phrases[1:]
                        
            for i in range(random.randint(0,10)):
                newphrase = phrase()
                while (phrases.find(newphrase)>-1):
                    newphrase = phrase()
                    
                phrases+=" "+newphrase
            phrases+="."
            if (j-1:
        msg = " "
        command = message.content[message.content.find("c!atb")+6:]
        command.strip()
        
        if command[0].isdigit():
            command = command.split(".")
            chapter = int(command[0])
            paragraph = int(command[1])

        else:
            try:    
                chapter = headings[command][0]
                paragraph = headings[command][1]
            except KeyError:
                pass
            
        if chapter > 0 and chapter <= 17 and paragraph > 0:
            try:
                msg = (chapters[chapter-1][paragraph-1]).format(message)
                await client.send_message(message.channel, msg)
            except IndexError:
                pass
    class Dialect:
        def __init__(self,prefixLetter,phonemes):
            self.prefix = prefixLetter
            
            #vowels
            self.a = phonemes[0]
            self.e = phonemes[1]
            self.i = phonemes[2]
            self.o = phonemes[3]
            self.u = phonemes[4]
            self.schwa = phonemes[5]
            
            self.aLong = phonemes[6]
            self.eLong = phonemes[7]
            self.iLong = phonemes[8]
            self.oLong = phonemes[9]
            self.uLong = phonemes[10]

            self.ai = phonemes[11]
            self.au = phonemes[12]
            self.ia = phonemes[13]
            self.ua = phonemes[14]

            #consonants
            self.bBroad = phonemes[15]
            self.dBroad = phonemes[16]
            self.fBroad = phonemes[17]
            self.gBroad = phonemes[18]
            self.ghBroad = phonemes[19]
            self.kBroad = phonemes[20]
            self.lBroad = phonemes[21]
            self.llBroad = phonemes[22]
            self.mBroad = phonemes[23]
            self.nBroad = phonemes[24]
            self.nnBroad = phonemes[25]
            self.ngBroad = phonemes[26]
            self.pBroad = phonemes[27]
            self.rBroad = phonemes[28]
            self.rrBroad = phonemes[29]
            self.sBroad = phonemes[30]
            self.tBroad = phonemes[31]
            self.vBroad = phonemes[32]
            self.chBroad = phonemes[33]

            self.bSlender = phonemes[34]
            self.dSlender = phonemes[35]
            self.fSlender = phonemes[36]
            self.gSlender = phonemes[37]
            self.ghSlender = phonemes[38]
            self.kSlender = phonemes[39]
            self.lSlender = phonemes[40]
            self.llSlender = phonemes[41]
            self.mSlender = phonemes[42]
            self.nSlender = phonemes[43]
            self.nnSlender = phonemes[44]
            self.ngSlender = phonemes[45]
            self.pSlender = phonemes[46]
            self.rSlender = phonemes[47]
            self.rrSlender = phonemes[48]
            self.sSlender = phonemes[49]
            self.tSlender = phonemes[50]
            self.vSlender = phonemes[51]
            self.chSlender = phonemes[52]

            self.h = phonemes[53]

    
    
    def transcribe (dialect):
        remainingMessage = message.content
        ipaList  = []
        ipa = ""

        while(remainingMessage.find(dialect.prefix + "/")>-1):
            #has opening and closing brackets and space before opening bracket
            if not(remainingMessage.find(dialect.prefix + "/")>0 and remainingMessage[remainingMessage.find(dialect.prefix + "/")-1]!=" ") and remainingMessage[remainingMessage.find(dialect.prefix + "/")+2:].find("/")>0:
                remainingMessage = remainingMessage[remainingMessage.find(dialect.prefix + "/")+2:]
                celticist = remainingMessage
                
                remainingMessage = celticist[celticist.find("/"):]
                celticist = celticist[:celticist.find("/")+1]
                
                #make sure there's no spaces before the opening bracket and after the closing bracket (this stops people accidentally triggering the bot)
                if celticist[0]!=" " and celticist[-1]!=" ":
                    ipa = ""
                    for i in range(0, len(celticist)-1):
                        if celticist[i]==" ":ipa+=" ";continue
                        if celticist[i]=="-":ipa+="";continue
                        if i0 and celticist[i-1] in "aiu":
                                    continue
                                elif celticist[i]=="a": ipa += dialect.aLong;i+=1;continue
                                elif celticist[i]=="e": ipa += dialect.eLong;i+=1;continue
                                elif celticist[i]=="i": ipa += dialect.iLong;i+=1;continue
                                elif celticist[i]=="o": ipa += dialect.oLong;i+=1;continue
                                elif celticist[i]=="u": ipa += dialect.uLong;i+=1;continue
                                continue
                            elif i0 and celticist[i-1] in "aiu":
                                    continue
                                else:
                                    if celticist[i]=="a" and celticist[i+1]=="i": ipa += dialect.ai;i+=1;continue
                                    if celticist[i]=="a" and celticist[i+1]=="u": ipa += dialect.au;i+=1;continue
                                    if celticist[i]=="i" and celticist[i+1]=="@": ipa += dialect.ia;i+=1;continue
                                    if celticist[i]=="u" and celticist[i+1]=="@": ipa += dialect.ua;i+=1;continue
                            if celticist[i]=="a": ipa += dialect.a
                            elif celticist[i]=="e": ipa += dialect.e
                            elif celticist[i]=="i": ipa += dialect.i
                            elif celticist[i]=="o": ipa += dialect.o
                            elif celticist[i]=="u": ipa += dialect.u
                            elif celticist[i]=="@": ipa += dialect.schwa

                            elif celticist[i]==":": ipa+=""
                            else: ipa+=celticist[i]
                    ipaList.append(ipa)
                    continue
                else: break
            else: break
        return ipaList
                    


    ulsterIrish = Dialect("u",ulsterPhonology)
    connachtIrish = Dialect("c",connachtPhonology)
    munsterIrish = Dialect("m",munsterPhonology)


    ulsterIrishTranscription = transcribe(ulsterIrish)
    connachtIrishTranscription = transcribe(connachtIrish)
    munsterIrishTranscription = transcribe(munsterIrish)

    msg = ""
    if len(ulsterIrishTranscription) > 0:
        transcription = transcribe(ulsterIrish)
        for i in range(len(transcription)):
            msg += '/' + transcription[i] + '/'
            if i < len(transcription):
                msg += ' '       
        msg = (msg).format(message)
        await client.send_message(message.channel, msg)

    msg = "" 
    if len(connachtIrishTranscription) > 0:
        transcription = transcribe(connachtIrish)
        for i in range(len(transcription)):
            msg += '/' + transcription[i] + '/'
            if i < len(transcription):
                msg += ' '       
        msg = (msg).format(message)
        await client.send_message(message.channel, msg)

    msg = ""
    if len(munsterIrishTranscription) > 0:
        transcription = transcribe(munsterIrish)
        for i in range(len(transcription)):
            msg += '/' + transcription[i] + '/'
            if i < len(transcription):
                msg += ' '       
        msg = (msg).format(message)
        await client.send_message(message.channel, msg)
        
    #~~~~~~~~~~~~~~~ PSEUDO-GAELIC SCRIPT ~~~~~~~~~~~~~~~
        
    if message.content.find("g/")>-1:
        #has opening and closing brackets and space before opening bracket
        if not(message.content.find("g/")>0 and message.content[message.content.find("g/")-1]!=" ") and message.content[message.content.find("g/")+2:].find("/")>0:
            latin = message.content[message.content.find("g/")+2:]
            latin = latin[:latin.find("/")+1]
            #make sure there's no spaces before the opening bracket and after the closing bracket (this stops people accidentally triggering the bot)
            if latin[0]!=" " and latin[-1]!=" ":
                gaelic = ""
                for i in range(0, len(latin)-1):
                    if latin[i] in "bcdfgmpstBCDFGMPST":
                        if latin[i+1].lower() == "h":
                            if latin[i]=="b": gaelic+="b\u0307";i+=1;continue
                            elif latin[i]=="c" and latin[i-1]!="#": gaelic+="c\u0307";i+=1;continue
                            elif latin[i]=="d": gaelic+="ꝺ\u0307";i+=1;continue
                            elif latin[i]=="f": gaelic+="ꝼ\u0307";i+=1;continue
                            elif latin[i]=="g": gaelic+="ᵹ\u0307";i+=1;continue
                            elif latin[i]=="m": gaelic+="m\u0307";i+=1;continue
                            elif latin[i]=="p": gaelic+="p\u0307";i+=1;continue
                            elif latin[i]=="s": gaelic+="ꞅ\u0307";i+=1;continue
                            elif latin[i]=="t": gaelic+="ꞇ\u0307";i+=1;continue

                            elif latin[i]=="B": gaelic+="b\u0307";i+=1;continue
                            elif latin[i]=="C": gaelic+="C\u0307";i+=1;continue
                            elif latin[i]=="D": gaelic+="Ꝺ\u0307";i+=1;continue
                            elif latin[i]=="F": gaelic+="Ꝼ\u0307";i+=1;continue
                            elif latin[i]=="G": gaelic+="Ᵹ\u0307";i+=1;continue
                            elif latin[i]=="M": gaelic+="M\u0307";i+=1;continue
                            elif latin[i]=="P": gaelic+="P\u0307";i+=1;continue
                            elif latin[i]=="S": gaelic+="S\u0307";i+=1;continue
                            elif latin[i]=="T": gaelic+="Ꞇ\u0307";i+=1;continue
                            continue
                        else:
                            if latin[i]=="b": gaelic+="b"
                            elif latin[i]=="c" and latin[i-1]!="#": gaelic+="c"
                            elif latin[i]=="d": gaelic+="ꝺ"
                            elif latin[i]=="f": gaelic+="ꝼ"
                            elif latin[i]=="g": gaelic+="ᵹ"
                            elif latin[i]=="m": gaelic+="m"
                            elif latin[i]=="p": gaelic+="p"
                            elif latin[i]=="s": gaelic+="ꞅ"
                            elif latin[i]=="t": gaelic+="ꞇ"

                            elif latin[i]=="B": gaelic+="b"
                            elif latin[i]=="C": gaelic+="C"
                            elif latin[i]=="D": gaelic+="Ꝺ"
                            elif latin[i]=="F": gaelic+="Ꝼ"
                            elif latin[i]=="G": gaelic+="Ᵹ"
                            elif latin[i]=="M": gaelic+="M"
                            elif latin[i]=="P": gaelic+="P"
                            elif latin[i]=="S": gaelic+="S"
                            elif latin[i]=="T": gaelic+="Ꞇ"
                            continue
                    elif latin[i] in "aeiouAEIOU":
                        if latin[i+1] == "~":
                            if latin[i]=="a": gaelic+="ⲁ́";i+=1;continue
                            elif latin[i]=="e": gaelic+="é";i+=1;continue
                            elif latin[i]=="i": gaelic+="í";i+=1;continue
                            elif latin[i]=="o": gaelic+="ó";i+=1;continue
                            elif latin[i]=="u": gaelic+="ú";i+=1;continue

                            elif latin[i]=="A": gaelic+="Ⲁ́";i+=1;continue
                            elif latin[i]=="E": gaelic+="Є́";i+=1;continue
                            elif latin[i]=="I": gaelic+="Í";i+=1;continue
                            elif latin[i]=="O": gaelic+="Ó";i+=1;continue
                            elif latin[i]=="U": gaelic+="Ú";i+=1;continue
                        elif latin[i+1] == "|":
                            if latin[i]=="a": gaelic+="ⲁ";i+=1;continue
                            elif latin[i]=="e": gaelic+="è";i+=1;continue
                            elif latin[i]=="i": gaelic+="ì";i+=1;continue
                            elif latin[i]=="o": gaelic+="ò";i+=1;continue
                            elif latin[i]=="u": gaelic+="ù";i+=1;continue

                            elif latin[i]=="A": gaelic+="Ⲁ";i+=1;continue
                            elif latin[i]=="E": gaelic+="Є";i+=1;continue
                            elif latin[i]=="I": gaelic+="Ì";i+=1;continue
                            elif latin[i]=="O": gaelic+="Ò";i+=1;continue
                            elif latin[i]=="U": gaelic+="Ù";i+=1;continue
                        else:
                            if latin[i]=="a": gaelic+="ⲁ"
                            elif latin[i]=="e": gaelic+="e"
                            elif latin[i]=="i": gaelic+="ı"
                            elif latin[i]=="o": gaelic+="o"
                            elif latin[i]=="u": gaelic+="u"

                    elif latin[i]=="A": gaelic+="Ⲁ"
                    elif latin[i]=="E": gaelic+="Є"
                    elif latin[i]=="I": gaelic+="I"
                    elif latin[i]=="O": gaelic+="O"
                    elif latin[i]=="U": gaelic+="U"
                    elif latin[i]=="á": gaelic+="ⲁ́"
                    elif latin[i]=="à": gaelic+="ⲁ"
                    elif latin[i]=="é": gaelic+="é"
                    elif latin[i]=="è": gaelic+="è"
                    elif latin[i]=="h":
                        if i>0 and latin[i-1] in "bcdfgmpstBCDFGMPST":
                            gaelic+=""
                        else:
                            gaelic+="h";
                    elif latin[i]=="í": gaelic+="í"
                    elif latin[i]=="ì": gaelic+="ì"
                    elif latin[i]=="j": gaelic+="ȷ"
                    elif latin[i]=="k": gaelic+="к"
                    elif latin[i]=="l": gaelic+="ᒐ"
                    elif latin[i]=="n": gaelic+="n"
                    elif latin[i]=="ó": gaelic+="ó"
                    elif latin[i]=="ò": gaelic+="ò"
                    elif latin[i]=="q": gaelic+="q"
                    elif latin[i]=="r": gaelic+="ꞃ"
                    elif latin[i]=="ú": gaelic+="ú"
                    elif latin[i]=="ù": gaelic+="ù"
                    elif latin[i]=="v": gaelic+="v"
                    elif latin[i]=="w": gaelic+="w"
                    elif latin[i]=="x": gaelic+="x"
                    elif latin[i]=="y": gaelic+="y"
                    elif latin[i]=="z": gaelic+="z"

                    elif latin[i]=="Á": gaelic+="Ⲁ́"
                    elif latin[i]=="À": gaelic+="Ⲁ"
                    elif latin[i]=="É": gaelic+="Є́"
                    elif latin[i]=="È": gaelic+="Є"
                    elif latin[i]=="H":
                        if i>0 and latin[i-1] in "bcdfgmpstBCDFGMPST":
                            gaelic+=""
                        else:
                            gaelic+="Һ"
                    elif latin[i]=="Í": gaelic+="Í"
                    elif latin[i]=="Ì": gaelic+="Ì"
                    elif latin[i]=="J": gaelic+="J"
                    elif latin[i]=="K": gaelic+="K"
                    elif latin[i]=="L": gaelic+="ᒐ"
                    elif latin[i]=="N": gaelic+="N"
                    elif latin[i]=="Ó": gaelic+="Ó"
                    elif latin[i]=="Ò": gaelic+="Ò"
                    elif latin[i]=="Q": gaelic+="Q"
                    elif latin[i]=="R": gaelic+="R"
                    elif latin[i]=="Ú": gaelic+="Ú"
                    elif latin[i]=="Ù": gaelic+="Ù"
                    elif latin[i]=="V": gaelic+="V"
                    elif latin[i]=="W": gaelic+="W"
                    elif latin[i]=="X": gaelic+="X"
                    elif latin[i]=="Y": gaelic+="Y"
                    elif latin[i]=="Z": gaelic+="Z"

                    #scribal abbreviations
                    elif latin[i]=="#":
                        #overdot
                        if latin[i+1]==".":
                            gaelic+="\u0307"
                        #suspension stroke
                        elif latin[i+1]=="-":
                            gaelic+="\u0305"
                        #m stroke
                        elif latin[i+1]=="~":
                            gaelic+="\u0303"
                        #"con" abbreviation
                        elif latin[i+1]=="c":
                            gaelic+="\u2184"
                        elif latin[i+1]=="C":
                            gaelic+="\u2183"
                            
                    elif latin[i]=="&": gaelic+="⁊"
                    elif latin[i]=="~": gaelic+=""
                    elif latin[i]=="." and latin[i-1]=="#": gaelic+=""
                    elif latin[i]=="-" and latin[i-1]=="#": gaelic+=""
                    elif latin[i]=="|": gaelic+=""
                    else: gaelic+=latin[i]

                msg = (gaelic).format(message)
                await client.send_message(message.channel, msg)

    #msg = input("Enter text: ")
    #await client.send_message(client.get_channel(channelId), msg)
                        
@client.event
async def on_ready():
    print('Logged in as')
    print(client.user.name)
    print(client.user.id)
    print('------')
    await client.change_presence(game=discord.Game(name="c!help for info"))

    #msg = input("Enter text: ")
    #await client.send_message(client.get_channel(channelId), msg)
client.run(TOKEN)