Skip to content

Instantly share code, notes, and snippets.

@MauroEldritch
Created December 4, 2020 14:56
Show Gist options
  • Save MauroEldritch/6100eb33af21ac5e73fc1491cab35e4b to your computer and use it in GitHub Desktop.
Save MauroEldritch/6100eb33af21ac5e73fc1491cab35e4b to your computer and use it in GitHub Desktop.
Discord_Bot.rb
#!/usr/bin/ruby
#Mauro Eldritch (plaguedoktor) @ DC5411 - 2020
#sudo gem install discordrb
require 'discordrb'
#The Token obtained from Discord: https://medium.com/@mauroeldritch/crear-bots-para-discord-en-ruby-en-s%C3%B3lo-10-pasos-778ab1a303f5 (Spanish)
$bot_token = ''
bot = Discordrb::Bot.new token: $bot_token
bot.message(with_text: "/hello") do |event|
event.respond "Hello!"
end
bot.message(with_text: "/bye") do |event|
event.respond "Bye!
"
end
bot.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment