Update Noblox to 6.0.2
This commit is contained in:
@ -4,7 +4,7 @@ const fs = require('node:fs');
|
||||
const noblox = require("noblox.js");
|
||||
const axios = require("axios").default;
|
||||
const { submissions, commands, cookies } = require("../config/config.js");
|
||||
const { getAssetInfo, getCurrentUser, SubmissionColumnsString, createSubmissionLine, getSubmissionLine, validateMapAsset, getValidationMessage } = require("../common.js");
|
||||
const { getAssetInfo, SubmissionColumnsString, createSubmissionLine, getSubmissionLine, validateMapAsset, getValidationMessage } = require("../common.js");
|
||||
|
||||
async function robloxUserFromDiscord(id) {
|
||||
if (isNaN(id)) return undefined;
|
||||
@ -52,7 +52,8 @@ async function execute(interaction) {
|
||||
|
||||
try {
|
||||
// Check that the bot owns this model
|
||||
if (!(await noblox.getOwnership(await getCurrentUser(), id, "Asset"))) {
|
||||
const robloxUser = await noblox.getAuthenticatedUser();
|
||||
if (!(await noblox.getOwnership(robloxUser.id, id, "Asset"))) {
|
||||
const msg = `🚫 The ${game} maptest bot's inventory does not contain this asset (id: \`${id}\`). You must use the /take command first.`;
|
||||
await interaction.editReply(msg);
|
||||
return;
|
||||
|
@ -1,7 +1,7 @@
|
||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||
const noblox = require("noblox.js");
|
||||
const { cookies, commands, gamePlaces } = require("../config/config.js");
|
||||
const { getAssetInfo, buyModel, getCurrentUser, validateMapAsset, getValidationMessage } = require("../common.js");
|
||||
const { getAssetInfo, buyModel, validateMapAsset, getValidationMessage } = require("../common.js");
|
||||
|
||||
/**
|
||||
* @param {import('discord.js').ChatInputCommandInteraction} interaction
|
||||
@ -20,7 +20,8 @@ async function execute(interaction) {
|
||||
let alreadyOwned;
|
||||
try {
|
||||
// Check if the bot already owns this asset
|
||||
alreadyOwned = await noblox.getOwnership(await getCurrentUser(), id, "Asset");
|
||||
const robloxUser = await noblox.getAuthenticatedUser();
|
||||
alreadyOwned = await noblox.getOwnership(robloxUser.id, id, "Asset");
|
||||
} catch (error) {
|
||||
if (error.message !== "400 The specified Asset does not exist!") {
|
||||
throw error;
|
||||
|
Reference in New Issue
Block a user