In deletePrompt return value of getSuggestion is used without a null/undefined check. For users that have MANAGE_GUILD this will result in the misleading message "I have removed the suggestion from the list." For users without that it will instead result in the following error and the bot will crash.
import { SlashCommandBuilder } from "@discordjs/builders";
^
TypeError: Cannot read properties of undefined (reading 'user_id')
at /app/src/commands/deletePrompt.ts:18:102
at Generator.next (<anonymous>)
at fulfilled (/app/src/commands/deletePrompt.ts:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
In
deletePrompt
return value ofgetSuggestion
is used without a null/undefined check. For users that have MANAGE_GUILD this will result in the misleading message "I have removed the suggestion from the list." For users without that it will instead result in the following error and the bot will crash.An identical bug exists in
editPrompt
.