Sha256: 2ff10834bc2f5fd852aa9c23e0905300cd733d7c14733dd53be27b5d5e197a22

Contents?: true

Size: 297 Bytes

Versions: 7

Compression:

Stored size: 297 Bytes

Contents

require "discorb"

client = Discorb::Client.new

client.once :ready do
  puts "Logged in as #{client.user}"
end

client.on :message do |_task, message|
  next if message.author.bot?
  next unless message.content == "ping"

  message.channel.post("Pong!")
end

client.run(ENV["DISCORD_BOT_TOKEN"])

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
discorb-0.0.7 examples/simple/ping_pong.rb
discorb-0.0.6 examples/simple/ping_pong.rb
discorb-0.0.5 examples/simple/ping_pong.rb
discorb-0.0.4 examples/simple/ping_pong.rb
discorb-0.0.3 examples/simple/ping_pong.rb
discorb-0.0.2 examples/simple/ping_pong.rb
discorb-0.0.1 examples/simple/ping_pong.rb