From 3dc74d722e9ac57150a9b8dea52bedd961b46a10 Mon Sep 17 00:00:00 2001 From: "Jill \"oatmealine\" Monoids" Date: Sun, 11 Jun 2023 18:35:15 +0300 Subject: [PATCH] various fixes all around --- src/commands/color.ts | 2 +- src/commands/garbagecollectroles.ts | 2 +- src/commands/markov.ts | 14 ++++++++++---- src/commands/monitor.ts | 20 -------------------- 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/src/commands/color.ts b/src/commands/color.ts index 716b7bd..808a299 100644 --- a/src/commands/color.ts +++ b/src/commands/color.ts @@ -1,4 +1,4 @@ -import { RoleCreateOptions, GuildMember, Interaction, Message, EmbedBuilder, TextChannel, ActionRowBuilder, ButtonBuilder, ButtonStyle, SlashCommandBuilder } from 'discord.js'; +import { RoleCreateOptions, GuildMember, Interaction, EmbedBuilder, TextChannel, ActionRowBuilder, ButtonBuilder, ButtonStyle, SlashCommandBuilder } from 'discord.js'; import { default as parseColor, Color } from 'parse-color'; import { isColorRole, COLOR_ROLE_SEPERATOR } from '../lib/assignableRoles'; diff --git a/src/commands/garbagecollectroles.ts b/src/commands/garbagecollectroles.ts index 9210230..feeb8cc 100644 --- a/src/commands/garbagecollectroles.ts +++ b/src/commands/garbagecollectroles.ts @@ -1,4 +1,4 @@ -import { CommandInteraction, Guild, GuildMember, Interaction, Role, SlashCommandBuilder } from 'discord.js'; +import { Guild, GuildMember, Interaction, Role, SlashCommandBuilder } from 'discord.js'; import { isColorRole, isPronounRole } from '../lib/assignableRoles'; async function fetchRoleMembers(role: Role) { diff --git a/src/commands/markov.ts b/src/commands/markov.ts index 12288d4..1d45c31 100644 --- a/src/commands/markov.ts +++ b/src/commands/markov.ts @@ -52,7 +52,7 @@ module.exports = { let participants: User[] = [member.user]; const context = interaction.options.getInteger('context') || 3; - const duration = 25000; + const duration = 25_000; const m = await interaction.reply({ fetchReply: true, @@ -109,12 +109,18 @@ module.exports = { try { const collected = await msg.channel.awaitMessages({ max: 1, - time: 30000, + time: 30_000, errors: ['time'] }); const message = collected.first() as Message; - sentence.push(...message.content.split(' ')); - await message.react(DONE_EMOJI); + + if (sentence.join(' ').length + message.content.length >= 2000) { + message.reply('stop that'); + sentence.push(...randomWord().split(' ')); + } else { + sentence.push(...message.content.split(' ')); + await message.react(DONE_EMOJI); + } } catch (err) { await p.send('Took too long... Surprise... Added...... :)'); sentence.push(...randomWord().split(' ')); diff --git a/src/commands/monitor.ts b/src/commands/monitor.ts index e6f09ac..225de96 100644 --- a/src/commands/monitor.ts +++ b/src/commands/monitor.ts @@ -5,26 +5,6 @@ const rand = require('random-seed').create(); const imagesEndpoint = 'https://commons.wikimedia.org/w/api.php?action=query&cmlimit=500&cmtitle=Category%3ALiminal_spaces&cmtype=file&list=categorymembers&format=json'; const imageEndpoint = 'https://commons.wikimedia.org/w/api.php?action=query&piprop=thumbnail&pithumbsize=200&prop=pageimages&titles={}&format=json'; -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')