Skip to content

Instantly share code, notes, and snippets.

@MazeW
Created June 29, 2018 22:17
Show Gist options
  • Save MazeW/cdf0362bf377417d35c126847deb8dba to your computer and use it in GitHub Desktop.
Save MazeW/cdf0362bf377417d35c126847deb8dba to your computer and use it in GitHub Desktop.
# l33t ruby bot made by yours truly
require 'discordrb'
require 'yaml'
config = YAML.load_file('config.yml')
client = Discordrb::Commands::CommandBot.new token: config['bot_token'], prefix: config['bot_prefix']
client.command(:ping, chain_usable: false, description: 'Basic ping command to test if bot is alive or not', usage: 'ping') do |event|
event.respond 'Pong!'
end
client.command(:roll, description: 'picks a random number from 1 to 6', usage: 'roll') do |event|
event.respond event.author.mention + ', you rolled ' + rand(1..5).to_s + '! :game_die:'
end
client.command(:test, chain_usable:false, description: 'test', usage: 'test') do |event|
event.channel.send_embed do |embed|
embed.title = 'penis'
embed.description = 'is big'
embed.image = Discordrb::Webhooks::EmbedImage.new(url: event.author.avatar_url)
end
end
client.run
bot_token: 't0ken'
bot_prefix: 'r>'
bot_owner: '77446106442629120'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment