Skip to content

Instantly share code, notes, and snippets.

@brecert
Created May 19, 2018 04:55
Show Gist options
  • Save brecert/f671d9e2e62dcc3ba378d7a30f4c36f4 to your computer and use it in GitHub Desktop.
Save brecert/f671d9e2e62dcc3ba378d7a30f4c36f4 to your computer and use it in GitHub Desktop.
<%= START -%>
<% filtered_chat = "&filtered_chat" %>
&filtered_chat = %CHAT%
<%
mappings = {
# Custom
"snowflake" => "❄",
"shrug" => "¯\\_(ツ)_/¯",
"code" => "%@#code%",
"snowman" => '☃',
"heart" => '❤',
"thin_heart" => '♥',
"sm" => '℠',
"fax" => '℻',
"!=" => '≠',
"health" => '%HEALTH%',
"username" => "%PLAYER%",
"seed" => "%SEED%",
# Emoji
"tm" => '™',
"trademarked" => '™',
"info" => 'ℹ',
"watch" => '⌚',
"hourglass" => '⌛',
# Normal
"cent" => '¢',
"pound" => '£',
"currency" => '¤',
"yen" => '¥',
"section" => '§',
"umlat" => '¨',
"female_ordinal" => 'ª',
# Missing a Few
"copyright" => '©',
"registered" => '®',
"degrees" => '°',
"macro_sign" => 'µ',
"pilcrow" => '¶',
"middle_dot" => '·',
"masculine_ordinal" => 'º',
"1/4" => '¼',
"1/2" => '½',
"3/4" => '¾',
"?" => '¿',
"multiplication_sign" => '×',
"multiply" => '×',
"division_sign" => '÷',
"divide" => '÷',
"delta" => 'Δ',
"xi" => 'Ξ',
"sigma" => 'Σ',
"omega" => 'Ω',
"en_dash" => '–',
"em_dash" => '—',
"horizontal_dash" => '―',
"bullet" => '•',
"!!" => '‼',
"<!?>" => '‽',
"??" => '⁇',
"?!" => '⁈',
"!?" => '⁉',
"arrrow_left" => '←',
"arrow_up" => '↑',
"arrow_right" => '→',
"arrow_down" => '↓',
"arrow_horizontal" => '↔',
"arrow_vertical" => '↕',
"sun" => '☀',
"cloud" => '☁',
"umbrella" => '☂',
"snowman" => '☃',
"comet" => '☄',
"star" => '★',
"black_star" => '★',
"white_star" => '☆',
"lightning_symbol" => '☇',
"thunderstorm_symbol" => '☈',
"telephone" => '☎',
"black_telephone" => '☎',
"white_telephone" => '☏',
"umbrella_with_raindrops" => '☔',
"hot_beverage" => '☕',
"coffee" => '☕',
"hot_chocolate" => '☕',
"hot_cocoa" => '☕',
"tea" => '☕',
"java" => '☕',
"shogi" => '☗',
"black_shogi_piece" => '☗',
"white_shogi_piece" => '☖',
"shamrock" => '☘',
"heart_bullet" => '☙',
"pointing_left" => '☜',
"pointing_up" => '☝',
"pointing_right" => '☞',
"pointing_down" => '☟',
"black_pointing_left" => '☚',
"black_pointing_right" => '☛',
"white_pointing_left" => '☜',
"white_pointing_up" => '☝',
"white_pointing_right" => '☞',
"white_pointing_down" => '☟',
"skull_and_crossbones" => '☠',
"death" => '☠',
"caution_sign" => '☡',
"radioactive_sign" => '☢',
"radioactive" => '☢',
"biohazard_sign" => '☣',
"biohazard" => '☣',
"caduceous" => '☤',
"ankh" => '☥',
"orthodox_cross" => '☦',
"chi_rho" => '☧',
"cross_of_lorrain" => '☨',
"cross_of_jerusalem" => '☩',
"star_and_crecent" => '☪',
"farsi_symbol" => '☫',
"adi_shakti" => '☬',
"hammer_and_sickle" => '☭',
"communism" => '☭',
"peace_symbol" => '☮',
"peace" => '☮',
"yin_yang" => '☯',
'black_sun' => '☀',
"white_sun" => '☼',
"first_quarter_moon" => '☽',
"last_quarter_moon" => '☾',
"moon" => '☾',
"mercury" => '☿',
"intersex" => '☿',
"female" => '♀',
"venus" => '♀',
"earth" => '♁',
"male" => '♂',
"mars" => '♂',
"jupiter" => '♃',
"saturn" => '♄',
"uranus" => '♅',
"neptune" => '♆',
"pluto" => '♇',
"aries" => '♈',
"taurus" => '♉',
"gemini" => '♊',
"cancer" => '♋',
"leo" => '♌',
"virgo" => '♍',
"libra" => '♎',
"scorpius" => '♏',
"sagittarius" => '♐',
"capricorn" => '♑',
"aquarius" => '♒',
"pisces" => '♓',
"white_chess_king" => '♔',
"white_chess_queen" => '♕',
"white_chess_rook" => '♖',
"white_chess_bishop" => '♗',
"white_chess_knight" => '♘',
"white_chess_pawn" => '♙',
"black_chess_king" => '♚',
"black_chess_queen" => '♛',
"black_chess_rook" => '♜',
"black_chess_bishop" => '♝',
"black_chess_knight" => '♞',
"black_chess_pawn" => '♟',
"black_spade_suite" => '♠',
"white_heart_suite" => '♡',
"white_diamond_suite" => '♢',
"black_club_suite" => '♣',
"white_spade_suite" => '♤',
"black_heart_suite" => '♥',
"black_diamond_suite" => '♦',
"white_club_suite" => '♧',
"hot_springs" => '♨',
"quarter_note" => '♩',
"eighth_note" => '♪',
"beamed_eighth_notes" => '♫',
"beamed_sixteen_notes" => '♬',
"music_flat_sign" => '♭',
"music_neutral_sign" => '♮',
"music_sharp_sign" => '♯',
"west_syriac_cross" => '♰',
"east_syriac_cross" => '♱',
"universal_recycling_symbol" => '♲',
"white_universal_recycling_symbol" => '♲',
"recycle" => '♲',
"black_universal_recycling_symbol" => '♻',
"wheelchair_symbol" => '♿',
"handicapped" => '♿',
"white_flag" => '⚐',
"black_flag" => '⚑',
"hammer_and_pick" => '⚒',
"anchor" => '⚓',
"crossed_swords" => '⚔',
"staff_of_aesculapius" => '⚕',
"scales" => '⚖',
"alembic" => '⚗',
"flower" => '⚘',
"gear" => '⚙',
"staff_of_hermes" => '⚚',
"atom_symbol" => '⚛',
"fluer-de-lis" => '⚜',
"fluer_de_lis" => '⚜',
"boyscout_symbol" => '⚜',
"warning_sign" => '⚠',
"warning" => '⚠',
"high_voltage_sign" => '⚡',
"lightning" => '⚡',
"doubled_female_sign" => '⚢',
"lesbian" => '⚢',
"doubled_male_sign" => '⚣',
"gay" => '⚣',
"interlocked_male_and_female_sign" => '⚤',
"heterosexual" => '⚤',
"male_and_female_signs" => '⚥',
"transgender" => '⚥',
"male_with_stroke_sign" => '⚦',
"male_with_stroke_and_male_and_female_sign" => '⚧',
"vertical_male_with_stroke_sign" => '⚨',
"horizontal_male_with_stroke_sign" => '⚩',
"medium_white_circle" => '⚪',
"medium_black_circle" => '⚫',
"medium_small_white_circle" => '⚬',
"marriage_symbol" => '⚭',
"divorce_symbol" => '⚮',
"unmarried_partnership_symbol" => '⚯',
"neuter" => '⚲',
}
def unicode_map(mappings, from, to)
mappings.merge! (from).to_a.zip((to).to_a).to_h
end
unicode_map mappings, ('^0'..'^9'), ('⁰'..'⁹')
unicode_map mappings, ('v0'..'v9'), ('₀'..'₉')
unicode_map mappings, ('o1'..'o9'), ('①'..'⑨')
unicode_map mappings, ('oA'..'oZ'), ('Ⓐ'..'Ⓩ')
unicode_map mappings, ('oa'..'oz'), ('ⓐ'..'ⓩ')
mappings['o0'] = '⓪'
unicode_map mappings, ('(1)'..'(9)'), ('⑴'..'⑼')
unicode_map mappings, ('(a)'..'(z)'), ('⒜'..'⒵')
unicode_map mappings, ('1.'..'9.'), ('⒈'..'⒐')
unicode_map mappings, ('die_face-1'..'die_face-6'), ('⚀'..'⚅')
unicode_map mappings, ('die_face_1'..'die_face_6'), ('⚀'..'⚅')
unicode_map mappings, ('die-1'..'die-6'), ('⚀'..'⚅')
unicode_map mappings, ('die_1'..'die_6'), ('⚀'..'⚅')
unicode_map mappings, ('dice-1'..'dice-6'), ('⚀'..'⚅')
unicode_map mappings, ('dice_1'..'dice_6'), ('⚀'..'⚅')
# Emoji.all.each do |emoji|
# if emoji.raw != "" && !emoji.raw.nil? && mappings[emoji.name].nil?
# p emoji.inspect
# mappings[emoji.name] = emoji.raw.to_s.chomp('️')
# end
# end
-%>
<% mappings.each do |k, v| %>
<%= "replace(#{filtered_chat},:#{k}:,#{v})" -%>
<% end %>
echo(%<%=filtered_chat%>%)
filter
<%= FINISH -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment