change the check

This commit is contained in:
imbwbl 2024-01-18 23:13:40 +01:00
parent e081330f79
commit 4648001dcf
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ export async function execute(interaction, defer=false) {
.then(response => { .then(response => {
let i = Math.floor(Math.random() * response.length) let i = Math.floor(Math.random() * response.length)
let ip = Math.floor(Math.random() * response[i].attachments.length) let ip = Math.floor(Math.random() * response[i].attachments.length)
if (response.length === 0 || response[i].attachments.length === 0) { if (!response.attachments || response.length === 0 || response[i].attachments.length === 0) {
return null return null
} }
return "https://coomer.su" + response[i].attachments[ip].path return "https://coomer.su" + response[i].attachments[ip].path

View File

@ -46,7 +46,7 @@ export async function execute(interaction, defer=false) {
.then(response => { .then(response => {
let i = Math.floor(Math.random() * response.length) let i = Math.floor(Math.random() * response.length)
let ip = Math.floor(Math.random() * response[i].attachments.length) let ip = Math.floor(Math.random() * response[i].attachments.length)
if (response.length === 0 || response[i].attachments.length === 0) { if (!response.attachments || response.length === 0 || response[i].attachments.length === 0) {
return null return null
} }
return "https://coomer.su" + response[i].attachments[ip].path return "https://coomer.su" + response[i].attachments[ip].path