e-a-h / That-Sky-Bot

That Sky [Bot] for thatgamecompany and #thatskygame
Creative Commons Attribution Share Alike 4.0 International
14 stars 3 forks source link

When an Emoji UID is not found, it makes get_emoji to permanently fail #33

Open jmmelko opened 4 years ago

jmmelko commented 4 years ago

Alex,

I have found that my config file, as yours, contain the following: "EMOJI": { "NO": 624094243371352084, "YES": 624094243329146900

When the bot is tested on a server that does not contain these emojis, the EMOJI dict in utils.Emoji.py is filled with the following: {'YES': None, 'NO': None}

=> I suggest to add the following line to get_emoji(name):

if name in EMOJI:
     if EMOJI[name] is not None:
         return EMOJI[name]
    else:
         return BACKUPS[name]

Thank you.

e-a-h commented 4 years ago

you can just remove the emojis from configs since they point to emojis not on your server. or you can add your own emoji and enter the IDs. it's meant for bot/server owner to properly add custom emoji to the config.

e-a-h commented 4 years ago

And on second thought, it might be good to both show the defaulted emoji and log the failure. If you happen to do this and make a pull request, I'll merge it ;)