Custom emoji bulk register(by console, xxx.png will be registred as :xxx:) v2
EMOJI_GLOB = '~path to emojis~/*.png' Dir.glob(EMOJI_GLOB).each do |e| shortcode = File.basename(e, '.png') CustomEmoji.find_or_initialize_by(shortcode: shortcode, domain: nil) do |emoji| open(e, 'rb') do |f| emoji.image = f emoji.save end end end; 1