Skip to content

Instantly share code, notes, and snippets.

@justinledwards
Created May 13, 2019 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinledwards/341bef0fe9f57fbef2b716bd53dad048 to your computer and use it in GitHub Desktop.
Save justinledwards/341bef0fe9f57fbef2b716bd53dad048 to your computer and use it in GitHub Desktop.
relay bot
require 'discordrb'
bot_token = ENV['BOT_TOKEN']
bot = Discordrb::Bot.new token: bot_token
bot.message(in: 492479830240133161) do |event|
mentions = event.message.role_mentions
mentions.each do |mention|
if mention.name == 'raids'
puts "raids was mentioned"
bot.channel(492480199489749006).send "#{event.author.nickname}: #{event.message} #{Time.now.strftime("%I:%M %p")}"
elsif mention.name == 'exraids'
puts "exraids was mentioned"
bot.channel(492480199489749006).send "#{event.author.nickname}: #{event.message} #{Time.now.strftime("%I:%M %p")}"
bot.channel(492485818858995713).send "#{event.author.nickname}: #{event.message} #{Time.now.strftime("%I:%M %p")}"
elsif mention.name == 'rares'
puts "rares was mentioned"
bot.channel(492485929446014977).send "#{event.author.nickname}: #{event.message} #{Time.now.strftime("%I:%M %p")}"
end
end
end
bot.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment