jillo-bot/src/commands/monitor.ts

113 lines
2.3 KiB
TypeScript

import { SlashCommandBuilder } from '@discordjs/builders';
import { CommandInteraction, MessageEmbed } from 'discord.js';
const rand = require('random-seed').create();
const images = [
'img1',
'img2',
'img3',
'img4',
'img5',
'img7',
'img8',
'img9',
'img10',
'img11',
'img12',
'img14',
'img15',
'img16',
'img17',
'img19',
'img20'
];
module.exports = {
data: new SlashCommandBuilder()
.setName('monitor')
.setDescription('Monitor')
.addStringOption((option) => option.setName('what').setDescription('Monitor what? Examples include: "lobby", "bedroom", "park", "playground", etc...').setRequired(true)),
execute: async (interaction: CommandInteraction) => {
let img;
let what = interaction.options.getString('what')!;
if (what.startsWith('the ')) what = what.slice(4);
switch (what.toLowerCase().trim()) {
case 'home':
img = 'img12';
break;
case 'hell':
img = 'img4';
break;
case 'fire pit':
img = 'img4';
break;
case 'party':
img = 'img23';
break;
case 'rollercoaster':
case 'park':
case 'amusement park':
img = 'img13';
break;
case 'pit':
case 'hole':
img = 'img21';
break;
case 'forest':
img = 'img18';
break;
case 'slide':
case 'metal slide':
case 'playground':
img = 'img6';
break;
case 'staircase':
img = 'img3';
break;
case 'security':
case 'security footage':
case 'camera':
img = 'img12';
break;
case 'lobby':
img = 'img19';
break;
case 'bedroom':
img = 'img20';
break;
case 'bathroom':
img = 'img10';
break;
case 'living room':
case 'livingroom':
img = 'img15';
break;
case 'store':
case 'shop':
img = 'img11';
break;
case 'void':
case 'darkness':
case 'emptiness':
img = 'img16';
break;
default:
rand.seed(what.toLowerCase().trim());
img = images[rand.range(images.length)];
break;
}
const embed = new MessageEmbed()
.setTitle(what)
.setImage(`https://oat.zone/f/monitor-images/${img}.png`)
.setFooter('Image may not always be accurate.')
.setTimestamp();
await interaction.reply({
embeds: [embed],
ephemeral: false,
});
}
};