Node-CallOfDuty: Error from datastore from calling PSN / XBL Accounts

PSN and Xbox side API, COD have changed they mw API some reasons. because even i tried username from cod.tracker.gg example: ARWannabes as PSN name and returns that same error.

since i dont own COD MW i cant even test with my username see if is api fallback.

{ type: 'com.activision.mt.common.stdtools.exceptions.NoStackTraceException', message: 'Error from datastore' }

What this using is coming from COD API to Discord BOT

So all callout coming from Discord Server Self but only thing that runs is by command and as small preview.

` if (args[1] === ‘mw’) { var plat = args[2];

                if (plat == "" || plat == null) return message.channel.sendMessage("Select platform `psn|xb1`");


                if (plat = "psn") {

                    var username = message.content.split(" ").slice(4).join(" ");

                    if (username == "" || username == null) return message.channel.sendMessage("Enter your Username from that Platform");

                    var urlInput = defaultBaseURL + "crm/cod/v2/title/" + modernwarfare + "/platform/psn/gamer/" + username + "/profile/type/mp"
                    var options = {
                        method: 'get',
                        url: urlInput,
                        headers: {
                            "content-type": "application/json",
                            "User-Agent": userAgent,
                            'Cookie': "is here",
                        }
                    };

                    axios(options).then(body => {
                        console.log(body.data.data);
                        if (body.data.data.message !== "Not permitted: user not found") {
                            let embed = new Discord.RichEmbed();
                            embed.setColor(0x9900FF)
                            embed.setAuthor(dclient.user.username + "#" + dclient.user.discriminator, dclient.user.avatarURL, "")
                            embed.setTitle(message.author.username + "#" + message.author.discriminator + " COD API (Modern Warfare Multiplayer)")
                            embed.setDescription("Your Call of Duty Modern Warfare (Multiplayer)")
                            embed.setThumbnail("https://portforward.com/call-of-duty-modern-warfare/call-of-duty-modern-warfare-logo.png")
                            embed.addField("Level: ", body.data.data.level, inline = true)
                            embed.addField("Prestige: ", body.data.data.prestige, inline = true)
                            embed.addField("Melee Kills: ", body.data.data.lifetime.all.melee, inline = true)
                            embed.addField("Deaths: ", body.data.data.lifetime.all.deaths, inline = true)
                            embed.addField("Kills: ", body.data.data.lifetime.all.kills, inline = true)
                            embed.addField("Total Games Played: ", body.data.data.lifetime.all.gamesPlayed, inline = true)
                            embed.setTimestamp()
                            embed.setFooter("Sent via " + dclient.user.username + " Using COD-API", dclient.user.avatarURL)
                            message.channel.sendMessage({ embed })
                        } else {
                            let embed = new Discord.RichEmbed();
                            embed.setColor(0x9900FF)
                            embed.setAuthor(dclient.user.username + "#" + dclient.user.discriminator, dclient.user.avatarURL, "")
                            embed.setTitle(message.author.username + "#" + message.author.discriminator + " COD API (Modern Warfare Multiplayer)")
                            embed.setDescription("Your Call of Duty Modern Warfare (Multiplayer)")
                            embed.setThumbnail("https://portforward.com/call-of-duty-modern-warfare/call-of-duty-modern-warfare-logo.png")
                            embed.addField("Error: ", "404", inline = true)
                            embed.addField("Message: ", "User not Found? Check if Correct Username you just Entered", inline = true)
                            embed.setTimestamp()
                            embed.setFooter("Sent via " + dclient.user.username + " Using COD-API", dclient.user.avatarURL)
                            message.channel.sendMessage({ embed })
                        }
                    }).catch(err => console.log(err));

                } else if (plat = "xb1") {

                    var username = message.content.split(" ").slice(4).join(" ");

                    if (username == "" || username == null) return message.channel.sendMessage("Enter your Username from that Platform");

                    var urlInput = defaultBaseURL + "crm/cod/v2/title/" + modernwarfare + "/platform/xb1/gamer/" + username + "/profile/type/mp"
                    var options = {
                        method: 'get',
                        url: urlInput,
                        headers: {
                            "content-type": "application/json",
                            "User-Agent": userAgent,
                            'Cookie': "is here",
                        }
                    };

                    axios(options).then(body => {
                        //console.log(body.data.data);
                        if (body.data.data.message !== "Not permitted: user not found") {
                            let embed = new Discord.RichEmbed();
                            embed.setColor(0x9900FF)
                            embed.setAuthor(dclient.user.username + "#" + dclient.user.discriminator, dclient.user.avatarURL, "")
                            embed.setTitle(message.author.username + "#" + message.author.discriminator + " COD API (Modern Warfare Multiplayer)")
                            embed.setDescription("Your Call of Duty Modern Warfare (Multiplayer)")
                            embed.setThumbnail("https://portforward.com/call-of-duty-modern-warfare/call-of-duty-modern-warfare-logo.png")
                            embed.addField("Level: ", body.data.data.level, inline = true)
                            embed.addField("Prestige: ", body.data.data.prestige, inline = true)
                            embed.addField("Melee Kills: ", body.data.data.lifetime.all.melee, inline = true)
                            embed.addField("Deaths: ", body.data.data.lifetime.all.deaths, inline = true)
                            embed.addField("Kills: ", body.data.data.lifetime.all.kills, inline = true)
                            embed.addField("Total Games Played: ", body.data.data.lifetime.all.gamesPlayed, inline = true)
                            embed.setTimestamp()
                            embed.setFooter("Sent via " + dclient.user.username + " Using COD-API", dclient.user.avatarURL)
                            message.channel.sendMessage({ embed })
                        } else {
                            let embed = new Discord.RichEmbed();
                            embed.setColor(0x9900FF)
                            embed.setAuthor(dclient.user.username + "#" + dclient.user.discriminator, dclient.user.avatarURL, "")
                            embed.setTitle(message.author.username + "#" + message.author.discriminator + " COD API (Modern Warfare Multiplayer)")
                            embed.setDescription("Your Call of Duty Modern Warfare (Multiplayer)")
                            embed.setThumbnail("https://portforward.com/call-of-duty-modern-warfare/call-of-duty-modern-warfare-logo.png")
                            embed.addField("Error: ", "404", inline = true)
                            embed.addField("Message: ", "User not Found? Check if Correct Username you just Entered", inline = true)
                            embed.setTimestamp()
                            embed.setFooter("Sent via " + dclient.user.username + " Using COD-API", dclient.user.avatarURL)
                            message.channel.sendMessage({ embed })
                        }
                    }).catch(err => console.log(err));

                }
                /*else if (plat = "pc") {

                                   var username = message.content.split(" ")[3].replace(/#/gmi, "%23");;
                                   username = username.replace(/([\w\W]*)%23\d+/gmi, '$1');
                                   console.log(username)

                                   if (username == "" || username == null) return message.channel.sendMessage("Enter your Username from that Platform");

                                   var urlInput = defaultBaseURL + "crm/cod/v2/title/" + modernwarfare + "/platform/battle/gamer/" + username + "/profile/type/mp"
                                   var options = {
                                       method: 'get',
                                       url: urlInput,
                                       headers: {
                                           "content-type": "application/json",
                                           "User-Agent": userAgent,
                                           'Cookie': "is here",
                                       }
                                   };

                                   axios(options).then(body => {
                                       //console.log(body.data.data);
                                       let embed = new Discord.RichEmbed();
                                       embed.setColor(0x9900FF)
                                       embed.setAuthor(dclient.user.username + "#" + dclient.user.discriminator, dclient.user.avatarURL, "")
                                       embed.setTitle(message.author.username + "#" + message.author.discriminator + " COD API (Modern Warfare Multiplayer)")
                                       embed.setDescription("Your Call of Duty Modern Warfare (Multiplayer)")
                                           //embed.setThumbnail(user.avatarURL)
                                       embed.addField("Level: ", body.data.data.level, inline = true)
                                       embed.addField("Prestige: ", body.data.data.prestige, inline = true)
                                       embed.addField("Melee Kills: ", body.data.data.lifetime.all.melee, inline = true)
                                       embed.addField("Deaths: ", body.data.data.lifetime.all.deaths, inline = true)
                                       embed.addField("Kills: ", body.data.data.lifetime.all.kills, inline = true)
                                       embed.addField("Total Games Played: ", body.data.data.lifetime.all.gamesPlayed, inline = true)
                                       embed.setTimestamp()
                                       embed.setFooter("Sent via " + dclient.user.username + " Using COD-API", dclient.user.avatarURL)
                                       message.channel.sendMessage({ embed })
                                   }).catch(err => console.log(err));

                               }*/
                else {
                    message.channel.sendMessage("You never Selected right Platform, Please Select `psn|xb1`")
                }
            }

`

i only took bit of code from your LIB since your LIB wasn’t even happy with discord LIB.

but everything works fine just cod MW some how has failed datastore background on error so im not sure they disabled API or not.

but i disable that command for now till i get response back.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

ah i found out issue, that errros me because tells me user hasn’t played a game so doesn’t detect it. when i do P-Hami as psn shows no stats so i thinking my side having issues or psn having issues