Showing emotes in both Twitch and Discord

Is there a way to get Nightbot to display an emote with the same text in both Twitch and Discord? For example, with the following !ping command:
!addcom !ping $(query)
!ping KKona
Nightbot will display the KKona emote in Twitch chat, but just “KKona” in plain text in Discord. Likewise, with
!ping :KKona:
Nightbot will display the KKona emote in Discord, but just “:KKona:” in plain text in Twitch chat.


You would have to create a Discord server emoji using a picture of the KKona emote (this applies to any Twitch emote you want Nightbot to display on the Discord server) and get the emoji ID (type \:KKona: in server chat). Use $(eval) to detect whether you’re using the command on Twitch or Discord, then determine if the input is the name of a server emoji.

!addcom -cd=5 !ping $(eval a=decodeURIComponent(`$(querystring)`);`$(provider)`==`discord`&&a==`:KKona:`?`<:KKona:EMOJI_ID>`:a)

EDIT 7/20/20: A rewrite for additional emojis

!addcom -cd=5 !ping $(eval a={`:KKona:`:`<:KKona:ID>`,`:bingHeart:`:`<bingHeart:ID>`,`:etc:`:`<etc:ID>`};b=decodeURIComponent(`$(querystring)`);(`$(provider)`==`discord`?b.split(` `).map(x=>a[x]||x).join(` `):b).slice(0,400)||`No input!`)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.