def generate_payload
        payload = {}
        payload[:channel]     = self.channel    unless self.channel.nil?
        payload[:username]    = self.username   unless self.username.nil?
        payload[:icon_url]    = self.icon_url   unless self.icon_url.nil?
        payload[:icon_emoji]  = self.icon_emoji unless self.icon_emoji.nil?
        payload[:text]        = self.text       unless self.text.nil?
        payload[:attachments] = self.attachments unless self.attachments.empty?

        payload
    end
def generate_payload
        payload = {}
        payload[:channel]     = self.channel    unless self.channel.nil?
        payload[:username]    = self.username   unless self.username.nil?
        payload[:icon_url]    = self.icon_url   unless self.icon_url.nil?
        payload[:icon_emoji]  = self.icon_emoji unless self.icon_emoji.nil?
        payload[:text]        = self.text       unless self.text.nil?
        payload[:attachments] = self.attachments unless self.attachments.empty?

        payload
    end
Generate the payload if stuff was provided