Sha256: 6e7e6903a6aea07528a8ce66e004b3fe47e2492502477f2f8648c252d28efc00
Contents?: true
Size: 681 Bytes
Versions: 4
Compression:
Stored size: 681 Bytes
Contents
class EventDecorator def initialize(event) @event = event end def channel @event.channel end def channel_id @event.channel.id end def username user.username end def user_id user.id end def users server.users end def mentions_for(user_ids) find_users(user_ids).map(&:mention) end def usernames_for(user_ids) find_users(user_ids).map(&:username) end private def find_users(user_ids) user_ids.map do |user_id| find_user(user_id) end end def find_user(user_id) users.find { |user| user.id == user_id } end def server @event.server end def user @event.user end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
qwtf_discord_bot-5.1.3 | lib/event_decorator.rb |
qwtf_discord_bot-5.1.2 | lib/event_decorator.rb |
qwtf_discord_bot-5.1.1 | lib/event_decorator.rb |
qwtf_discord_bot-5.1.0 | lib/event_decorator.rb |