How to retrieve Destiny stats through Nightbot

Asked Apr 29, 2015·117 replies·Last activity 3 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Update: Sep 29, 2017.

Destiny 2 Update!

Hello!

With this command you will be able to check stats from:

  • Destinytracker.com
  • Guardian.GG
  • DestinyTrialsReport.com
  • Almost every single PvE/PvP stat in Destiny
  • Info about weeky activities (For example: Xur, Nightfall, Trials)
  • Info about your equiped gear / weapons

The command is a combination of Nightbot, DestinyTracker.com, Guardian.GG API, Trials.report API, Bungie's API and some custom code.

How it works:

!destiny < action > < gamertag/psn > < console >

< action >
'Action' is the stat you would to display.
Full up to date action list here: https://2g.be/twitch/destiny/commandlist/

< gamertag/psn >
The username you use on your xbox or playstation.
For example: !destiny kd username xbox

< console >
Available consoles are: xbox/ps.
If your GT/PSN is only used on one of these consoles, you won't have to enter your console, this will be auto detected.

A few examples:
!destiny (To see the available actions)
!destiny score xgerhard ps (ps = playstation)
!destiny crucibletime xgerhard xbox
!destiny kd xgerhard (No console in the command, the default console will be taken)

https://cdn.discordapp.com/attachments/113948431512240128/207528695282270209/…

Installing is simple, place this line in your chat or add through nightbot backend:

!commands add !destiny -cd=5 $(urlfetch https://2g.be/twitch/destinyv2.php?user=$(user)&channel=$(channel)&format=$(provider)&query=$(querystring)&bot=nightbot&defaultconsole=xbox)

Note: Make sure to change xbox to your personal default console xbox/ps.

117 replies

If you already have an old !Destiny command added to Nightbot and you want to update this command you can use the following command:

!commands edit !destiny -cd=5 $(urlfetch https://2g.be/twitch/destinyv2.php?user=$(user)&channel=$(channel)&format=$(provider)&query=$(querystring)&bot=nightbot&defaultconsole=xbox)

Note: Make sure to change xbox to your personal default console xbox/ps.

Or use the copy-paste command generator here: https://2g.be/twitch/destiny/command-generator/

I try to keep this post up to date, to check if there are updates:
!destiny patchnotes

If the command isn't working, check the status with:
!destiny status
If the Status is "Up and running" but the command isn't working, please let me know.

If you want to share the command with friends or other streamers run:
!destiny install
This will show a link with the installation guide.

So I heard you like statistics:
!destiny stats

Tip:
Use the following command to link your Twitch account to your GT/PSN
!destiny setplayer < username > < console >
After this you can use all the commands without typing your GT/PSN, for example:
!destiny trialskd (Which will look up your saved GT/PSN)

Questions or feedback?
Twitch: Xgerhard
Twitter: @member
Discord: Xgerhard#2439

Very awesome of you to make something like this, thanks!

what if you have a _ in your psn id... i have noticed that doesnt .. do you know if there is a work around... I do like this command and I thank you for it

What is your PSN, I tested some names with _ they work fine here. Maybe because there is a xbox user with the same name? Version 2 is coming soon, that will include an extra parameter for your console, that might fix the problem.

Version 2 will also include all destinytracker stats like KD, KDA, W/L.

I was trying rc_crispy... 2.0 will be sweet :)

Do you think you could the same with GTA V?

@Swift Frog If there is an online leaderbords, its possible. However I'm not really a GTA player and I'm building these things in my spare time, so I dont think I'll build these commands for GTA.

The games that I might add in the future are: Halo, BF, CoD, LoL.

@Swift Frog My custom command is in my first post above. But you have to write a script that communicates between nighbot and the game database.
I dont want to share my script source yet, since it's not finished yet. But basicly you have to find the webpage of the data you want to show, grab that data, filter it, and display it on a webpage. The nightbot customapi can retrieve this data and display it in chat.

ok thanks I will try to figure it out <3

@Gerhard do you think you could come and help me with that in a twitch channel?

Version 2 is added in my startpost, this topic will close in a few hours, so for question, tips, contact me on twitter @member or on twitch @member

The topic is reopened. Slight misconfiguration caused topics to close even if active.

2.0 works great but i didn't know that if you were on Playstation you have to put ps at the end

Thanks for the feedback! Yeah I had to add a console to the command since there were people who got a Xbox and Playstation account. The xbox and playstation info is stored seperately so I need to know where I have to grab the information from. If there is no console given, it will choose xbox, my personal choice since I'm a xbox player :)

!Destiny command is used over 6k! Feedback or requests are always welcome. Thanks for using it!

Version two isnt working it wont display the kda ext

Thanks for noticing, destinytracker changed their format, everything should be working again.

I appreciate all the people who share the command but apparantly there is an imposter of me on Twitch, my twitch username is Xgerhard and twitter Gerhardoh. I'm working on this project by myself, so if other people claiming to be working with me, please let me know.

Currently working on a way to change the default console for Playstation streamers.

If you have any questions or feedback just let me know.

You can choose your own default console now.

Please check the start post for the last update.

These commands only work with Nightbot?

I need help with the command. I change the GT and make sure the console is on xbox. But I get this message when I try to use it. Such as !destiny lvl--That returns "Can't find embeddedmeteorundefined in the destiny database."

Good to hear, if you have questions just let me know.

Hey, I added this as a command to my Nighbot but was wondering if the list of actions could be shortened since only a few actions seem to be used and it sometimes creates a huge wall of avaible actions..

Thanks for using the command. Yes I'm still doubting what to do with the list of actions, there are way more actions then shown. I'm thinking about making the default "!destiny" response just a short text with explanation of the command, then I will add a "!destiny pve" and "!destiny pvp" for available actions, plus "!destiny pvp control" for specific actions for some playlists.
Let me know what you think about that.

I think "!Destiny pve" and "!Destiny pvp" would be very efficient hence most people just don't know how to use the command rather than know the action, that would make new viewers less confused when someone uses the command I feel like! Love the idea!
Side note opinion: I don't think people on Twitch are very interested in knowing their specific rank in a PvP playlist, I feel like they're more interested in flat stats like: time played, total kills, most kills, kd, etc. but that's just from what I've noticed.

Love the command btw, keep it up!

Yes I agree, for new people its confusing, the only thing they see is "!destiny", and no info how to use it. I'll change this later today.
About the ranks, I think thats really a personal choice, but I can add an option for the streamer to hide the ranks. However you have to edit the command if I add that. I have some other things on my to do list, but I think I'll have that option added this weekend.
Thanks for the input!

Hey, was busy with stuff and couldn't really test it out too much but used the command again yesterday.
It sure feels less complicated but yet feel the normal !destiny command without actions feels too long..
Is it possible to shorten it? I was thinking of
"Type !destiny <action> <gt/psn> <xbox/ps> to check your stats. Type !destiny pve/pvp for actionlist." or something like that.
Also, another thing with the pvp actionlist, could it be a thing that it only shows the pvp actions and at the end it just says "Type !destiny playlist for playlist stats" just to shorten the !destiny pvp actionlist?

I don't wanna make it sound like it's bad now but it's pretty annoying for streamers to see a huge block of text appear and miss a comment. Viewers sure like this command though!
But I had to delete it in several channels because they thought it was just too large of a text appearing if someone used the !destiny or !destiny pvp.

Hey, thanks for the feedback and testing out the new format. I really don't know what to do with the default destiny command. It is way shorter than it was, but its still not short. The amount of wrong usages is still high, so I feel like there should be an a small guide + example in the default command.
For the PvP part, I understand its a long message, but keep in mind if people want to see a specific playlist they have to enter "!destiny" then "!destiny pvp'" and then for example "!destiny rumble", so thats 3 commands and the user still has no stats. Plus if you use Nightbot the command has ~20 sec cooldown for 'normal' viewers, so if a user needs to enter 4 commands to show the stats he wants... almost impossible.
I understand it's a wall of text, but I personally haven't heard a streamer complain about it yet.
So let's talk about what I can change, if people want different responses from the server, I could add a webbased settings page per stream, where can you enter default texts and maybe some other settings, However this is not a small adjustment so I can't really give an ETA for this. But let me know what you think.

I think that would be amazing!
How would the entering of your own command responses work though?
Just wondering, because I'm not the smartest with costum APIs and such lol.

I like the idea though, if that could be a thing in the futute, I feel like way more channels would add it just so the responses could match a channels' usual feel to them I guess.

Generally for an API it will give you a very basic text. And with that text you can customize around it to make it yours. However, unless specified, there isn't much change to the basic text that an api gives. There are exceptions of course.

Glad you like the idea. How its going to work? Since the channelname is in the command I can see from which channels the requests are coming, so based on the channelname I could Load settings from my database. So I can choose to display default responses or custom responses. I need to think about it for a bit, but most likely I Will make a twitch login button for the streamer to make sure its really the streamer. Then they can setup an account and fill in their settings.

There are some other cool things that hopefully are going to change, but I cant really talk about that yet, but they have a bit priority. So yeah I really dont know when this settings page Will go live. But I Will keep you all posted here.

I saw we just hit 40k commands, thank you all :)

Sounds great to me!

I'll check here regularly to see on updates on the command too. 😄

Hey xgerhard

Just wondering how the progress for the command is going? 😄

I'm currently working on the dashboard feature for settings, since there are multiple games upcoming (Spoiler Kappa), I need to make it, so I can easily add the other games when they release. So there are some big code changes, which took a while.

But I can say these changes will be live in the next 10 days.

Hey, thanks for trying out the command.
Your code to add is:

!addcom !destiny $(customapi https://2g.be/twitch/destinyv2.php?action=$(1)&gamertag=$(2)&user=$(user)&bot=nightbot&console=$(3)&channel=shat360&defaultconsole=ps)

If you type '!destiny' it will give you basic info about the command.
Type for example '!destiny kd luminosity48' and it will show you his KD.

Just wanted to say thank you very much for this, good work :D

Thanks Alot for this ^_^
I'm just slowly starting out streaming and getting some tips as I go. And alot of people jump in and try to check KDs, and I never knew how to set it up. I shall give you a follow on twitch and lurk ^_^

This is absolutely brilliant, great job. One thing though, you have a 'character' breakdown in PvP for k/d's aka ckd, can you create one that can do that for raid completions but not just for nm and hm raids but as a nm+hm total too? Examples of the command calls could be: ckfnm, ckfhm, ckft as well as maybe kft? I'm thinking now that the ckft would be the better option as an example could be "[Player]'s character's Kings Fall total completions are: Warlock 11 [3 nm/8 hm], Hunter, 12 [1 nm/11 hm] and Titan 9 [0 nm/9 hm]. Total = 32." I understand if this is not possible, but something along those lines would be great.

Thanks.

Are you still ever going to make one for Halo?

I've edited alot of stuff which will be live soon, I'll check if I can add this aswell. Raid character breakdown shouldn't be a problem, I'll keep you posted.

Back when Halo released I started making one, but since the Twitch viewer counts were so disappointing, I never ended up finishing it. At some point I want to finish it, but it has no priority over my current projects.

Looking forward to the patch notes. Keep up the good work 🙂

Loving this bot after seeing it in a friend's stream! Thanks, @Gerhard

There is an API for Halo 5, but there is no Nightbot custom command yet :)

@Brisk Crocodile In case you missed the tweet, the raid character breakdown is in there now.

Hi xgerhard
I have a questions that has been harrasing me lately lol.

I've seen streamers pull the Destiny stats just entering !tt and they are not sharing the how to...
Any ideas?

Thanks

Hey! Yes thats possible using alias.
I tweeted this out a while ago, I'll use the same images here (@DestinyCommand):

<img src='>

<img src='>

So I assume !tt stands for trialsteam, so you would need:
!commands add !tt -a=!destiny trialsteam $(query)

So when you use !tt xgerhard xbox, Nightbot will run !destiny trialsteam xgerhard xbox.

Good luck!

CgpvQWTWMAAcrSJ.jpgCgpvQWSWkAAe1ic.jpg

Hey xgerhard,

Thanks a lot for the pointing on it.
Im new to the forum (kinda lost sorry) reason i asked on this large topic
I appreciate your response and explanation on it.

Hey there! Great work with this! Is there any way to retrieve information on a gamertag with spaces in the name? Thanks!

Heya! Yes there is, use + for spaces in your Gamertag/PSN, for example:
!destiny trialskd user+with+spaces xbox

If you're tired off having to type your username all the time, there is a pretty new feature to link your GT/PSN to your Twitch account, you type:
!destiny setuser user+with+spaces xbox

After that you can use !destiny trialskd without typing your GT/PSN.

Hope this helps!

xgerhard,

Nightbot has been working great on our discord server, but yesterday we got a message saying "something went wrong at the bungie servers."

Ever since then, nightbot will not pull stats, or even respond to any commands whatsoever. I tried disconnecting and reconnecting it to the server, but we still have the same problem. Any insight into how to resolve this issue?

I should also add that I created a test server and had nightbot join, and everything works just fine there.

Thanks!

Heya! Thats weird, yesterday there was server maintenance at Bungie (which usually happens at tuesday), so almost all commands would respond the Bungie server error. However when the maintenance was finished, everything should work normally.
Does Nightbot respond to '!commands' ? If not make sure its not banned and that Nightbot has the right role to talk.

I made sure the bot has the necessary roles, but it won't respond to anything at all. Not even !commands

I was just disconnecting the account, not parting servers. I just parted the server and re-joined and it works now! Thanks for all your help 🙂

is there anyway I can set the command to only show my stats? like gamertag= or username thanks!

Dainty Fox said:
is there anyway I can set the command to only show my stats? like gamertag= or username thanks!

Yes there is, replace USERNAMEHERE with your gamertag/psn, and replace CONSOLEHERE with xbox or ps in the following command:

!commands add !destiny -cd=5 -ul=everyone $(urlfetch https://2g.be/twitch/destinyv2.php?action=$(querystring)&format=$(provider)&user=$(user)&channel=$(channel)&bot=nightbot&console=CONSOLEHERE&gamertag=USERNAMEHERE)

Hey there @Gerhard is there any eta on when we'll have a command built in for Wrath of the Machine completions?

There is already, I just have been slacking updating the command list:
!destiny wotm <username>
Or the long one:
!destiny wrathofthemachine <username>

Is it possible to have it automatically look up the trials kd of a player instead of his overall. My friends viewers have trouble typing !destiny trialskd (user) can you make it so you just need to type !destiny (user) if so how.

Yes, the link will just have to be modified to be specifically for that one thing.

Here is one that should do what you need, replace the command name with whatever you want:

!commands add !trialskd $(urlfetch https://2g.be/twitch/destinyv2.php?action=trialskd&format=$(provider)&user=$(user)&channel=$(channel)&bot=nightbot&console=CONSOLEHERE&gamertag=$(touser))

Replace the CONSOLEHERE part with the console you need, and thats it. They can put in a specific gamertag, if they don't then it will default to their twitch name.

Another thing is it possible to change the website to trials report over destiny tracker because destiny tracker is outdated

What do you mean, what's outdated? The command uses both sites for certain data.

nevermind i put the wrong command in sorry for wasting your times

sorry to bug you guys again my friend now want it to show weekly trials kd instead of overall sorry im trying to help him set it up

Yeah just copy-paste the command Slikrick posted earlier, just change 'trialskd' to 'trialsweekly'. However this won't just show the kd but also the matches played and won. There is no seperate one for just weekly trials kd.

Hey there! Try to edit the command and add a ) at the end of the command (to close the urlfetch function).

Also this is in discord not twitch.

This should not matter, copy paste the following code in either your discord or twitch chat:
!commands edit !destiny $(urlfetch https://2g.be/twitch/destinyv2.php?user=$(user)&channel=$(channel)&format=$(provider)&query=$(querystring)&bot=nightbot&defaultconsole=ps)

Hello, how can I use this same command in youtube gaming?

The exact same thing posted above works for all services.

Hello this article help me set up most of my commands, but when I type !destiny setplayer < johnmurr17 > < PS >
I get this response:

johnny_shmurr117: can't find '< johnmurr17 > < PS>' in the destiny database.

Plz help, thank you

Heya! The <> are just placeholders, try removing them.
!destiny setplayer johnmurr17 ps
This should work.

lol yea I kept fiddling with it and figured it out
But yea this whole thrread was very helpful, thank you

Could anybody tell me the k/d and rank for a PlayStation player - johnnyfebruary please would greatly appreciate it. I can't seem to get it work

If you already have the !destiny command you simply add:
!commands add !kd -a=!destiny kd johnnyfebruary ps

If you dont have the !destiny command use this one:
!commands add !kd $(urlfetch https://2g.be/twitch/destinyv2.php?query=kd johnnyfebruary ps&format=$(provider)&user=$(user)&channel=$(channel)&bot=nightbot)

@Gerhard, are you possibly considering adding functionality to pull Destiny 2 stats with Nightbot? My clan makes heavy use of the work you've already done for D1 (much appreciated, btw), and we are very interested in Destiny 2 stats nowadays. Looking forward to your reply!

Hey there! Yes, there will be an update for Destiny 2 stats, however the game is a bit too addicting to stop playing atm :) Check @member on Twitter for latest updates.

Ha, I don't blame you 😆 That's great news, though! Looking forward to it. And thanks for the twitter info!

There is an update available for Destiny 2 streamers:

!commands add !destiny $(urlfetch http://destinycommand.com/api/command?query=$(querystring)&default_console=xbox)

More info: destinycommand.com

@Quirky Shrimp

@Gerhard Thanks, friend! Much appreciated

Is there a way to set these commands as a timer? Because I'm trying to add the command so that my stats and loadout spam in intervals on my nightbot but its not recognizing the command or its saying I cannot use the alias.

@Purple Ladybug Yes you can set it as a timer. when you create the timer, you put the command name in the Alias field, then the specific inputs (what you'd put after the command to specify user, channel, format, query, bot, default console) in the Message field.

Could you show me an example or screen shot where to place this when I add the timer. For example I use !destiny loadout Kronosnk xbox. I place it in the alias and in chat it says cannot be found. What am I missing in the message field?

@Purple Ladybug You should put only !destiny in the Alias field. Put loadout Kronosnk xbox in the Message field.

Awesome! Thank you so much for your help. I will definitely try it out. One more thing are there commands yet for the raids in Destiny 2?

Is there any way to make primary/secondary/heavy act as stand-alone commands to be used without having to type !destiny primary ... ?

I also noticed that the weapon masterwork type stops showing and only displays "masterwork" when the weapon is masterworked. Before that it shows tier x (whatever).

Thanks in advance.

Yes this is possible just take the command below:

!addcom !primary -a=!destiny primary $(query)

This would be the primary command your looking for. To add the others simply change out both instances of primary with whatever stat you want to look up. You can also change the first instance as that as just what you want the name of the command to be. Hope this helped 🙂.

Is there a reason why its pulling Destiny 1 stats and not Destiny 2?

Hi, then you are using the old command. Delete your current, and check destinycommand.com for the D2 version.

Is there any way to do that with streamelements too?
Been trying to figure out a way to do it, but i failed. Streamelements use of alias is weird af.
If you do a !command alias add !primary !destiny primary "user" "console", you end up having "destiny" "user" "console" as aliases (only because primary is already a command name)

I have no idea this forum is meant for nightbot support and not stream elements

Hello,

Is there a way to fetch a specific profile’s stats when there are multiple profiles with the same name?

I have been trying to set up commands to show equipped items stats, but for some reason it pulls up the info from another player who uses the exact same name.

Destinycommand only pulls out the other guys stats/equipment and i cant find any way to get the ones i want.

Thanks in advance.

P.S. This is unrelated to any specific bot.
Would it maybe be possible to use the steam profile ID, (E.G. 4611686018485755839) for the stat lookup, since it's present in all the sites destinycommand queries?

#destinytracker.com/destiny-2/profile/steam/4611686018485755839/overview
#guardian.gg/2/profile/4611686018485755839/LiiiPy
#destinytrialsreport.com/report/3/4611686018485755839

Hiya, yea steam usernames are tricky since they aren't unique. However for your use-case I do have a solution, if you go here and sign in: https://www.bungie.net/en/Profile/Settings/
You will see an option for "Unique ID", you can choose a name here and use that inside the !destiny command.

How to you use it:
!destiny primary <unique id> bungienet
For example:
!destiny primary xgerhard bungienet

Or if you only want a command from for a certain item only:
!commands add !primary $(urlfetch https://destinycommand.com/live/api/command?response_user=$(touser)&query=primary xgerhard bungienet)

Ooh that is good news!
I am using it for 1 item commands indeed, but because i was using it with streamelements i came up with something similar.

!command add !primary ${customapi.https://destinycommand.com/api/command?query=primary+vinneh911&bot=streamelements&user=${user}&default_console=pc}

Thank you so much for the reply.

If you don't mind, i have another question.

I noticed when it comes to weapons masterwork type only shows until tier 9 mw but once it is fully masterworked it only says "masterwork".

Is that something that can be fixed or is it someting on bunigie's side of their API?

Thanks again and have a great day!

Sorry to bother you again.

I tried what you suggested and it works, but only shows the name and level, it doesn't show the equipment perks and mods such.

Any ideas how i can fix that?

Here's a screenshot of the response i get.

Untitled.jpg

No worries, it should show perks + mods if they are enabled, however I guess this means my manifest (destiny item database) is out of date, it updates automatically normally, but the destiny API is struggling at the moment, so I can't test it. Hopefully it will resolve itself later.
About the masterwork, good question, I'll have to test that out as well to see what the Bungie API returns.

Great! The perks and mods are showing now.

Thank you very much xgerhard,

I hope you have a great day.

hi i hope this is still active. im trying to use nightbot for showing my in game loadouts and stats but am unsure how to start the process, is there a url i need to edit? or do i type something in my twitch chat? ive read here for a while and tried alot of things but nothing

Didn't find your answer? The community is on Discord.

Ask on Discord