Discordapp Bot - Ruby

API Discussion
Edited: just in case people don't want to scroll through:

I have the discordapp chat bot ready for public use.

The mods of the /r/wow discord have been kind enough to accept it on the server. If you're already a member of that server, you can type "?help" to see all the commands available. If you're not a member of that Discord server, but have your own and would like to try it out you can go to:
https://discordapp.com/oauth2/authorize?&client_id=169952497690083328&scope=bot&permissions=3200

It only requires 'Read Messages' and 'Send Messages', but it will require someone with the manage server permission to add it.

Greetings community,

I've decided to try and create a Discord bot that ties into the WoW api. Now I'm practically new to coding, and have been getting my feet wet with some easier attempts at bot making, but I figured why not bang my head against something harder.

I've looked at the sticky and have found both meta_nexus and rbattlenet and have been using https://github.com/wingyu/rbattlenet .

What I'm basically trying to do, at least just to start, is create a !ilvl command that will bring up a characters average item level.
ex. People Input: !ilvl [Character] [Realm]
ex. Bot Outputs: [Character]'s item level is [averageItemLevel]

The following is what I've gotten so far, with a bit of a help from another. Any finger in the right direction would be greatly appreciated.

require 'discordrb'
require 'rbattlenet'

bot = Discordrb::Commands::CommandBot.new token: '', application_id: '', prefix: '?'

api_key = ''
RBattlenet.authenticate(api_key: api_key)
RBattlenet.set_region(region: "us", locale: "en_US")

bot.command(:ilvl, chain_usable: false, description: "Gets ilvl for character") do |event, *text|
event.respond "#{RBattlenet::Wow::Character.find(name: text[0], realm: text[1])}"
end

bot.run
are you talking about the public battle.net API or the ingame API for addons ?
cause this place is for the first, and not for the 2nd while you make it sound like you're making an in-game add-on.
(and tbh: don't name your addon a bot as 'bots' are against ToU ;) )

And try to make it possible to use on EU/CN/... other regions as well, instead of hardcoding it to US-region only ;)
I'm pretty sure Chuey is talking about Discord as in http://discordapp.com, not Discord Unit Frames.

Unfortunately I have no experience whatsoever with Discord's extensions/addons and can't quite begin to wrap my head around how one would integrate a chat bot with OAuth. That seems like it would be tricky ...
You could use the private chat to provide the bot your access token (Combined with a web page) and then you can use the users access token in every command he uses.

Best regards
Quick update: Thanks for the replies btw. I have actually gotten the project off the ground and moving in a good direction. It's currently in a workable state, but I'd like to get it more refined before I share it. Thanks everyone though for the assistance.
Average item level is publicly available so You don't need Oauth to get it. Use character profile query with "items" parameter in additional fields and then look for "averageItemLevel" or "averageItemLevelEquipped" fields in "items" key of the returned JSON data.
I have the discordapp chat bot ready for public use.

The mods of the /r/wow discord have been kind enough to accept it on the server. If you're already a member of that server, you can type "?help" to see all the commands available. If you're not a member of that Discord server, but have your own and would like to try it out you can go to:
https://discordapp.com/oauth2/authorize?&client_id=169952497690083328&scope=bot&permissions=3200

It only requires 'Read Messages' and 'Send Messages', but it will require someone with the manage server permission to add it.
05/08/2016 04:42 AMPosted by Chuey
I have the discordapp chat bot ready for public use.

The mods of the /r/wow discord have been kind enough to accept it on the server. If you're already a member of that server, you can type "?help" to see all the commands available. If you're not a member of that Discord server, but have your own and would like to try it out you can go to:
https://discordapp.com/oauth2/authorize?&client_id=169952497690083328&scope=bot&permissions=3200

It only requires 'Read Messages' and 'Send Messages', but it will require someone with the manage server permission to add it.


added to my server and recommended to a few of users too :)
Shweet....many thanks
Telling all my friends and acquaitences

Thnak you <3
Got a request from a PvP Guild using Discord.
Is there a way to return PvP Stas?
ie. Season Ranking, number of fights won/lost
something about information regarding "rbgs, 3s, 2s, 5s etc"

I do not PvP, so I am not much help here :/

Apparently folks are loving this.

Thanks for your hard work <3
The Folks at @Friendshipmoose have a question.

Is there a way to check for teh soecific account wide achievement for obtaining a Heroic Archimond kill or if they have obtained their moose mount?
Thanks for the positive comments everyone! Sorry I haven't check back in a bit, but I'm here with some answers.

PvP Question: Not atm there isn't, but since it's been requested I will get to work on it! :)

Achievement Question: Again, not at the moment but I will also work on that as well!

Thank you for suggestions!
Both those commands are now implemented.

?help also now gives you a link to a google doc with specifics instead of a huge list of the commands into chat.

?pvp realm character region brings up ratings, wins, and losses of every bracket
?moose realm character region checks for archimonde moose :)
Thanks again Chuey <3
Big big big big question... >< does this bot works on Starcraft 2?

I saw this bot
https://www.reddit.com/r/starcraft/comments/5vaf0m/introducing_a_starcraft_discord_bot_coming_soon/

but they have no link, so I'm wondering if this and that bot is the same.. lol

I'd Looveeee to be able to use one Blizzard bot for all games @.@
Overwatch, Diablo, Starcraft, WoW

anyway good job!
hello why pay overwatch
04/14/2016 11:50 AMPosted by Chuey
Edited: just in case people don't want to scroll through:

I have the discordapp chat bot ready for public use.

The mods of the /r/wow discord have been kind enough to accept it on the server. If you're already a member of that server, you can type "?help" to see all the commands available. If you're not a member of that Discord server, but have your own and would like to try it out you can go to:
https://discordapp.com/oauth2/authorize?&client_id=169952497690083328&scope=bot&permissions=3200

It only requires 'Read Messages' and 'Send Messages', but it will require someone with the manage server permission to add it.

Greetings community,

I've decided to try and create a Discord bot that ties into the WoW api. Now I'm practically new to coding, and have been getting my feet wet with some easier attempts at bot making, but I figured why not bang my head against something harder.

I've looked at the sticky and have found both meta_nexus and rbattlenet and have been using https://github.com/wingyu/rbattlenet .

What I'm basically trying to do, at least just to start, is create a !ilvl command that will bring up a characters average item level.
ex. People Input: !ilvl [Character] [Realm]
ex. Bot Outputs: [Character]'s item level is [averageItemLevel]

The following is what I've gotten so far, with a bit of a help from another. Any finger in the right direction would be greatly appreciated.

require 'discordrb'
require 'rbattlenet'

bot = Discordrb::Commands::CommandBot.new token: '', application_id: '', prefix: '?'

api_key = ''
RBattlenet.authenticate(api_key: api_key)
RBattlenet.set_region(region: "us", locale: "en_US")

bot.command(:ilvl, chain_usable: false, description: "Gets ilvl for character") do |event, *text|
event.respond "#{RBattlenet::Wow::Character.find(name: text[0], realm: text[1])}"
end

bot.run
[FR] ( use google translation )
Moi et un ami avons creer un serveur discord spécial jeux blizzard , nous cherchons des bots spécialiser dedans et celui-ci ne marche pas ( il est deconnecter )
voir sur le serveur ( link ) : https://discord.gg/ZMcXjv3

Join the Conversation

Return to Forum