For some reason, nothing after the line that sends a get request to the Roblox API works.I am not getting any errors. The body that the Roblox API returns for their status endpoint looks like this.
{"status":"๐๐๐คก๐น๐คก๐๐คกโ ๏ธ๐๐คก"}
Did I make a mistake in my code anywhere?
} else if (msg.startsWith(prefix+"staffverify")) {
if (args[0]) {
request("http://api.roblox.com/users/get-by-username?username="+args[0], function(error, response, body) {
let JSONbody = JSON.parse(body)
if (JSONbody.success !== false) {
if (error) {
embed.setTitle("API ERROR")
embed.setDescription("An unexpected error occured. Please contact a developer to report the issue and try again later.\n\n```"+error+"```")
message.channel.send(embed)
return
}
let arr = ["๐","๐","๐","๐คช","๐","โ ๏ธ","๐คก","๐คก","๐คก","๐บ","๐น","๐ค ","๐","๐","๐","โ๏ธ","๐","๐ฅช","๐ฌ"]
let code = ""
var i
for (i = 0; i < 10; i++) {
code = code+arr[Math.floor(Math.random() * arr.length)]
}
const collector = new discord.MessageCollector(message.channel, m => m.author.id === message.author.id, { time: 10000 });
embed.setTitle("VERIFICATION")
embed.setDescription("Please put the following code in your Roblox **status**. Once you have put the code in your status, reply to this message with ?done. To cancel the prompt, say ?cancel.\n\n```"+code+"```")
embed.setImage("https://i.imgur.com/RO9H5Tu.png")
message.channel.send(embed)
collector.on('collect', msg => {
if (msg.content == "!done") {
request("https://users.roblox.com/v1/users/"+JSONbody.Id+"/status", function(error, response, body) {
if (JSON.parse(body).status == code) {
message.channel.send("Verified.")
} else {
message.channel.send("Not verified.")
}
})
}
})
} else {
embed.setTitle("ERROR")
embed.setDescription("There was an issue while attempting to verify the username you specified.\n\n```"+JSONbody.errorMessage+"```")
message.channel.send(embed)
}
})
}
})