Sha256: 56a560e24a6cf6c4e93c8f52feba8c2903987aae1864655ec66445f9d1c862fe

Contents?: true

Size: 548 Bytes

Versions: 8

Compression:

Stored size: 548 Bytes

Contents

class QwtfDiscordBotServer < QwtfDiscordBot
  def run
    bot = Discordrb::Commands::CommandBot.new(
      token: TOKEN,
      client_id: CLIENT_ID,
      prefix: '!'
    )

    bot.command :server do |event, *args|
      hostname = args.first || endpoint
      qstat_request = QstatRequest.new(hostname)
      message = qstat_request.server_summary
      embed = qstat_request.to_embed

      if embed
        event.channel.send_embed(message, embed)
      else
        event.channel.send_message(message)
      end
    end

    bot.run
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
qwtf_discord_bot-1.0.8 lib/qwtf_discord_bot/qwtf_discord_bot_server.rb
qwtf_discord_bot-1.0.7 lib/qwtf_discord_bot/qwtf_discord_bot_server.rb
qwtf_discord_bot-1.0.6 lib/qwtf_discord_bot/qwtf_discord_bot_server.rb
qwtf_discord_bot-1.0.5 lib/qwtf_discord_bot/qwtf_discord_bot_server.rb
qwtf_discord_bot-1.0.4 lib/qwtf_discord_bot/qwtf_discord_bot_server.rb
qwtf_discord_bot-1.0.3 lib/qwtf_discord_bot/qwtf_discord_bot_server.rb
qwtf_discord_bot-1.0.2 lib/qwtf_discord_bot/qwtf_discord_bot_server.rb
qwtf_discord_bot-1.0.1 lib/qwtf_discord_bot/qwtf_discord_bot_server.rb