First move to functions

This commit is contained in:
2023-04-08 14:33:08 +02:00
parent e7b54ce476
commit 6d77b3bee3
2 changed files with 63 additions and 0 deletions

14
utils/functions.js Normal file
View File

@@ -0,0 +1,14 @@
const fetch = require("axios");
async function getuuid(ign) {
const mojangAPI = "https://api.mojang.com/users/profiles/minecraft/"
try {
const user = await fetch(mojangAPI + ign)
return user.data.id;
} catch (error) {
return null;
}
}
module.exports = getuuid;