The Ctrl + V Game

Seriel

Doing her best
Member
Joined
Aug 18, 2015
Messages
3,299
Trophies
3
Age
24
Location
UK
XP
6,062
Country
United Kingdom
Code:
module SerieBot
    module Logging
        require 'rumoji'
        extend Discordrb::Commands::CommandContainer
        extend Discordrb::EventContainer
        def self.get_message(event, state)
            if state == nil or state == "{DELETE}"     
        if (event.channel.private?)
          server_name = "DM"
          channel_name = event.channel.name
        else
          server_name = event.server.name
          channel_name = "##{event.channel.name}"
        end
        messages[event.message.id] = {
        :event => event,
        :server => server_name,
        :channel => channel_name,
        }
       
        content = Rumoji.encode(event.message.content)
        event.message.mentions.each { |x| content = content.gsub("<@#{x.id.to_s}>", "<@#{x.distinct}>") ; content = content.gsub("<@!#{x.id.to_s}>", "\@#{x.distinct}") }
       
        attachments = event.message.attachments
        id = Base64.strict_encode64([event.message.id].pack('L<'))
       
        puts "#{state}(#{id}) #{event.message.timestamp.strftime('[%D %H:%M]')} #{server_name}/#{channel_name} <#{event.message.author.distinct}> #{content}"
        puts "<Attachments: #{attachments[0].filename}: #{attachments[0].url} >" unless attachments.empty?
      else
        if messages[event.id].nil?
          puts "{DELETE} Message with ID {event.id} was deleted, but the contents couldn't be fetched."
        end
       
        delete_event = messages[event.id][event]
        server_name = messages[event.id][:server]
        channel_name = messages[event.id]
       
        content = Rumoji.encode(delete_event.message.content)
        delete_event.message.mentions.each { |x| content = content.gsub("<@#{x.id.to_s}>", "<@#{x.distinct}>") ; content = content.gsub("<@!#{x.id.to_s}>", "\@#{x.distinct}") }

        attachments = delete_event.message.attachments
        id = Base64.strict_encode64([delete_event.message.id].pack('L<'))
        puts "#{state}(#{id}) #{delete_event.message.timestamp.strftime('[%D %H:%M]')} #{server_name}/#{channel_name} <#{delete_event.message.author.distinct}> #{content}"
        puts "<Attachments: #{attachments[0].filename}: #{attachments[0].url} >" unless attachments.empty?
        end
        end
       
        message do |event|
            next if Config.ignored_servers.include?(event.server.id) rescue nil
            self.get_message(event, nil)
        end
       
        message_edit do |event|
            next if Config.ignored_servers.include?(event.server.id) rescue nil
            self.get_message(event, "{EDIT}")
        end
   
    message_delete do |event|
      next if Config.ignored_servers.include?(event.server.id) rescue nil
      self.get_message(event, "{DELETE}")
    end
   
    member_join do |event|
      puts "[#{Time.now.strftime('[%D %H:%M]')}] #{event.member.distinct} joined \{#{event.server.name}\}"
    end
   
    end
end
 

smileyhead

I like cute stuff.
OP
Member
Joined
Aug 31, 2015
Messages
4,808
Trophies
3
Age
23
Location
Budakeszi, Hungary
Website
sites.google.com
XP
10,650
Country
Hungary
PpQA9s9.png
<- It's an image, not the emoticon. I shared it through Discord.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • BigOnYa @ BigOnYa:
    Ratings for it are calling it bad, but it looks cool. Damn 48/100 rating.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa,
    looks are deceiving
  • BigOnYa @ BigOnYa:
    Yea people always down vote games anymore seems like, good or bad, bunch of haters
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, review bombing?
    +1
  • K3Nv2 @ K3Nv2:
    Yeah seems like people hate on original ideas anymore
  • K3Nv2 @ K3Nv2:
    Oh were sorry our small dev team can't shit out a cod clone every 6 months
    +1
  • K3Nv2 @ K3Nv2:
    Mostly positive on steam
  • BigOnYa @ BigOnYa:
    Eew, you use steam, I'm down voting you cause you not using or playing what I like.
  • K3Nv2 @ K3Nv2:
    Yes and epic and gog, sleep with me
  • K3Nv2 @ K3Nv2:
    Gay
  • BigOnYa @ BigOnYa:
    Homophobic
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, whats wrong with steam?
  • BigOnYa @ BigOnYa:
    Nothing, I was just teasing
  • K3Nv2 @ K3Nv2:
    He's a big tease trying to take my booty
  • BigOnYa @ BigOnYa:
    No, I don't wanna make ancientboi mad, I know you two already have a thing going
    +1
  • K3Nv2 @ K3Nv2:
    He divorced me once I threatened him with the fbi
    +2
  • Xdqwerty @ Xdqwerty:
    @K3Nv2,
    he also fucked uremum despite being gay
  • K3Nv2 @ K3Nv2:
    Yeah so did you and I want back child support pay enjoy the lawsuits
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, im virgin
  • K3Nv2 @ K3Nv2:
    So was mother Theresa
  • BigOnYa @ BigOnYa:
    @XdqwertyThat's ok, he is too
    +1
  • K3Nv2 @ K3Nv2:
    Uremum doesn't think so
    +2
  • Xdqwerty @ Xdqwerty:
    good night
    Xdqwerty @ Xdqwerty: good night