Sha256: 6e9b0efca3de02f715521a9f54245057350ddc529c43c0e38c1e7cc048981d7d

Contents?: true

Size: 333 Bytes

Versions: 2

Compression:

Stored size: 333 Bytes

Contents

# frozen_string_literal: true
require "discorb"

client = Discorb::Client.new

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

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

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

client.run(ENV.fetch("DISCORD_BOT_TOKEN", nil))

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
discorb-0.17.1 examples/simple/ping_pong.rb
discorb-0.17.0 examples/simple/ping_pong.rb