From 0923d3b58a67feed549e516b4c99c4cd5ace14b6 Mon Sep 17 00:00:00 2001
From: Carter Penterman <carterpenterman@gmail.com>
Date: Fri, 21 Oct 2022 23:04:23 -0500
Subject: [PATCH] update discord to roblox api

---
 commands/submit.js | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/commands/submit.js b/commands/submit.js
index b240145..ee44dfb 100644
--- a/commands/submit.js
+++ b/commands/submit.js
@@ -2,13 +2,13 @@ const { SlashCommandBuilder } = require('@discordjs/builders');
 const { parse } = require("csv-parse/sync");
 const fs = require('node:fs');
 const noblox = require("noblox.js");
-const axios = require("axios").default
+const axios = require("axios").default;
 
 async function robloxUserFromDiscord(id) {
     if (isNaN(id)) return undefined;
     try  {
-        const res =  await axios.get(`https://verify.eryn.io/api/user/${id}`)
-        return res.data.robloxId
+        const res =  await axios.get(`https://api.fiveman1.net/v1/users/${id}`);
+        return res.data.result.robloxId;
     } catch (error) {
         return undefined;
     }
@@ -17,17 +17,17 @@ async function robloxUserFromDiscord(id) {
 async function robloxUsernameFromId(id) {
     if (isNaN(id)) return undefined;
     try  {
-        const res =  await axios.get(`https://users.roblox.com/v1/users/${id}`)
-        return res.data.name
+        const res =  await axios.get(`https://users.roblox.com/v1/users/${id}`);
+        return res.data.name;
     } catch (error) {
         return undefined;
     }
 }
 
 async function execute(interaction) {
-    const userId = await robloxUserFromDiscord(interaction.user.id)
+    const userId = await robloxUserFromDiscord(interaction.user.id);
     if (!userId) {
-        const msg = "You don't have a Roblox account linked with your Discord account. Visit https://verify.eryn.io/";
+        const msg = "You don't have a Roblox account linked with your Discord account. Use !link with rbhop dog to link your account.";
         await interaction.reply({content: msg, ephemeral: true});
         return;
     }