Use API that isn't rate-limited and some extras #7
@ -56,7 +56,7 @@ async function execute(interaction) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const assetInfo = await getAssetInfo(id);
|
const assetInfo = await getAssetInfo(id);
|
||||||
if (assetInfo.creatorId != userId) {
|
if (assetInfo.creatorId !== userId) {
|
||||||
const assetUsernamePromise = robloxUsernameFromId(assetInfo.creatorId);
|
const assetUsernamePromise = robloxUsernameFromId(assetInfo.creatorId);
|
||||||
const interactionUsernamePromise = robloxUsernameFromId(userId);
|
const interactionUsernamePromise = robloxUsernameFromId(userId);
|
||||||
const assetUsername = await assetUsernamePromise;
|
const assetUsername = await assetUsernamePromise;
|
||||||
@ -66,7 +66,7 @@ async function execute(interaction) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Shouldn't really be possible but who knows...
|
// Shouldn't really be possible but who knows...
|
||||||
if (assetInfo.typeId != AssetType.Model) {
|
if (assetInfo.typeId !== AssetType.Model) {
|
||||||
await interaction.reply({content: `This asset (id: ${id}) is not a model. Your map must be a model.`, ephemeral: true});
|
await interaction.reply({content: `This asset (id: ${id}) is not a model. Your map must be a model.`, ephemeral: true});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ async function execute(interaction) {
|
|||||||
for (let record of records) {
|
for (let record of records) {
|
||||||
const rid = record[0];
|
const rid = record[0];
|
||||||
const rtimestamp = record[1];
|
const rtimestamp = record[1];
|
||||||
if (id == rid) {
|
if (id === rid) {
|
||||||
await interaction.reply({content: `This map (id: ${id}) was already submitted on <t:${rtimestamp}:d>.`, ephemeral: true});
|
await interaction.reply({content: `This map (id: ${id}) was already submitted on <t:${rtimestamp}:d>.`, ephemeral: true});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user