ProgrammingLooking for someone to help create a discord botPosted:

Chat
  • Shoutbox Hero
Status: Offline
Joined: Jan 10, 20126 Year Member
Posts: 7,037
Reputation Power: 6296
Motto: Chaotic360 Support & Seller | Matrix, Destruction & NiNJA User | If you need support feel free to message me ;)
I wanna keep it simple, I'm down to pay although would be nice to get it free or cheap.

Lets get some backstory and what it'll be used for.

well I and a friend have started a community related around Call of Duty, Scrims, Giveways and all of that good stuff, of course it was a really requested thing to add a Black Ops 4 stat tracker.

now I understand you may say but someone has released one, that is correct there's a public one which I feel could be improved on a lot due to it sending a picture of the stats, whilst it's cool the quailty isn't great.

although that isn't my main reason anyway, I'm wanting to add to this bot so it'll do more than track stats, allowing me to elimiate other bots that take up room.
#2. Posted:
-Deano
  • Rated Awesome
Status: Offline
Joined: Aug 19, 20108 Year Member
Posts: 5,004
Reputation Power: 441
Just to help you along in the right direction, you can use the callofdutytracker api to get game stats for Black Ops 4.

[ Register or Signin to view external links. ]

You can parse this json to use in your bot/webhook.

For example, here's my stats based on Battle.net platform and my username:
[ Register or Signin to view external links. ]
#3. Posted:
Chat
  • 5K Undisputed
Status: Offline
Joined: Jan 10, 20126 Year Member
Posts: 7,037
Reputation Power: 6296
Motto: Chaotic360 Support & Seller | Matrix, Destruction & NiNJA User | If you need support feel free to message me ;)
-Deano wroteJust to help you along in the right direction, you can use the callofdutytracker api to get game stats for Black Ops 4.

[ Register or Signin to view external links. ]

You can parse this json to use in your bot/webhook.

For example, here's my stats based on Battle.net platform and my username:
[ Register or Signin to view external links. ]


I've actually got the API and stuff, I had a friend look over it and he ended up getting most of the stuff, but I'm still rather lost myself so going to keep looking into it until maybe I can get someone with a brain to help me out

Thank you though, gives me a bit more of an idea.
#4. Posted:
-Deano
  • Rated Awesome
Status: Offline
Joined: Aug 19, 20108 Year Member
Posts: 5,004
Reputation Power: 441
If you need help, you can always post the specific issue on here and I'm sure someone will help you out. You'll find people are more willing to help you along with an issue rather than solving it entirely for you in the first place.
#5. Posted:
Chat
  • E3 2017
Status: Offline
Joined: Jan 10, 20126 Year Member
Posts: 7,037
Reputation Power: 6296
Motto: Chaotic360 Support & Seller | Matrix, Destruction & NiNJA User | If you need support feel free to message me ;)
-Deano wroteIf you need help, you can always post the specific issue on here and I'm sure someone will help you out. You'll find people are more willing to help you along with an issue rather than solving it entirely for you in the first place.



Yeah I wont lie I'm stuck at step one, like creating the bot got it, but pulling info from API & making it work as a command etc etc, I'm near enough lost in the middle of a jungle stranded in the middle of nowhere hahaha.

Although if I make some progress, I will make sure it's very specific.
#6. Posted:
-Deano
  • Rated Awesome
Status: Offline
Joined: Aug 19, 20108 Year Member
Posts: 5,004
Reputation Power: 441
What language have you made the bot in? Might help to point you in the right direction.
#7. Posted:
Chat
  • Blind Luck
Status: Offline
Joined: Jan 10, 20126 Year Member
Posts: 7,037
Reputation Power: 6296
Motto: Chaotic360 Support & Seller | Matrix, Destruction & NiNJA User | If you need support feel free to message me ;)
-Deano wroteWhat language have you made the bot in? Might help to point you in the right direction.



I've legit just followed a guide using discord.io as I'm still learning through the stuff, probably will try and refresh my mind on Javascript and what not eventually, just trying to manage so much stuff right now it's not easy
#8. Posted:
-Deano
  • Rated Awesome
Status: Offline
Joined: Aug 19, 20108 Year Member
Posts: 5,004
Reputation Power: 441
Assuming the rest of the bot is Javascript then, you can get the data from the API using an ajax request like so:


var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(e) {
   if (this.readyState === 4) {
      if (this.status === 200) { // If request was successful
         var response = JSON.parse(xhr.responseText); // This is the data sent back
         
         // You can use this as output, e.g.
         // response.stats.level is your level.
         // response.stats.kills is your killcount, etc.
      }
   }
}

var url = "https://cod-api.theapinetwork.com/api/stats/";
var game = "bo4";
var username = "USERNAME%23NUMBERS"; // Battle.net format which is in Name#0000 format
var platform = "bnet";

xhr.open("GET", `${url}/${game}/${username}/${platform}`);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send();


I'll leave the username capture to you.
#9. Posted:
Chat
  • Gold Gifter
Status: Offline
Joined: Jan 10, 20126 Year Member
Posts: 7,037
Reputation Power: 6296
Motto: Chaotic360 Support & Seller | Matrix, Destruction & NiNJA User | If you need support feel free to message me ;)
-Deano wroteAssuming the rest of the bot is Javascript then, you can get the data from the API using an ajax request like so:


var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(e) {
   if (this.readyState === 4) {
      if (this.status === 200) { // If request was successful
         var response = JSON.parse(xhr.responseText); // This is the data sent back
         
         // You can use this as output, e.g.
         // response.stats.level is your level.
         // response.stats.kills is your killcount, etc.
      }
   }
}

var url = "https://cod-api.theapinetwork.com/api/stats/";
var game = "bo4";
var username = "USERNAME%23NUMBERS"; // Battle.net format which is in Name#0000 format
var platform = "bnet";

xhr.open("GET", `${url}/${game}/${username}/${platform}`);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send();


I'll leave the username capture to you.



Thank you for your help, I'll start to investigate on that and see if I can make some progress
Users browsing this topic: None
Jump to:


RECENT POSTS

HOT TOPICS