Sha256: 3efd9c0e84796efabe3e68ea4276e15e53588e7b1973b0ea3fcfd5ef5d5b3606

Contents?: true

Size: 432 Bytes

Versions: 2

Compression:

Stored size: 432 Bytes

Contents

# frozen_string_literal: true
require "discorb"

client = Discorb::Client.new

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

client.slash(
  "admin", "You can run this command if you have Administrator permission",
  dm: false,
  default_permission: Discorb::Permission.from_keys(:administrator),
) do |interaction, _name|
  interaction.post("Hello, admin!")
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/commands/permission.rb
discorb-0.17.0 examples/commands/permission.rb