fix crash list when empty message in reminder GUI
All checks were successful
PR Check / lint-and-format (pull_request) Successful in 19s
All checks were successful
PR Check / lint-and-format (pull_request) Successful in 19s
This commit is contained in:
parent
cd1dedce6c
commit
fc189ab552
1 changed files with 7 additions and 4 deletions
|
@ -6,10 +6,12 @@ export default {
|
|||
data: {
|
||||
name: getFilename(__filename),
|
||||
},
|
||||
interaction: async (interaction: ModalSubmitInteraction, client: Client) =>
|
||||
newReminder(client, interaction.fields.fields.get("reminderGUI-time")!.value, {
|
||||
interaction: async (interaction: ModalSubmitInteraction, client: Client) => {
|
||||
const message = interaction.fields.fields.get("reminderGUI-message")?.value;
|
||||
|
||||
return newReminder(client, interaction.fields.fields.get("reminderGUI-time")!.value, {
|
||||
locale: interaction.locale,
|
||||
message: interaction.fields.fields.get("reminderGUI-message")?.value ?? null,
|
||||
message: message ? (message.length > 0 ? message : null) : null,
|
||||
createdAt: interaction.createdAt.getTime(),
|
||||
channelId: interaction.channelId,
|
||||
userId: interaction.user.id,
|
||||
|
@ -19,5 +21,6 @@ export default {
|
|||
content: msg as string,
|
||||
ephemeral: true,
|
||||
}),
|
||||
),
|
||||
);
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue