Module: Discordify

Defined in:
lib/discordify.rb,
lib/discordify/client.rb,
lib/discordify/message.rb,
lib/discordify/version.rb

Defined Under Namespace

Classes: Client

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.push_message(avatar, username, content, webhook = nil) ⇒ Object



6
7
8
# File 'lib/discordify/message.rb', line 6

def push_message(avatar, username, content, webhook = nil)
  client(webhook).post_json(username: username, message: content, avatar: avatar)
end

.push_message_async(avatar, username, content, webhook = nil) ⇒ Object



10
11
12
13
14
# File 'lib/discordify/message.rb', line 10

def push_message_async(avatar, username, content, webhook = nil)
  Thread.start do
    push_message(avatar, username, content, webhook)
  end
end