feat: Reminders #44
1 changed files with 8 additions and 2 deletions
|
@ -163,9 +163,10 @@ export default {
|
|||
// eslint-disable-next-line no-case-declarations
|
||||
let time = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt1_name`) as string);
|
||||
const message = interaction.options.getString(loc_default?.get(`c_${filename}_sub1_opt2_name`) as string);
|
||||
let option = OptionReminder.Nothing;
|
||||
let seconds: number;
|
||||
if (time != null) {
|
||||
// Cli
|
||||
let option = OptionReminder.Nothing;
|
||||
|
||||
// Split time
|
||||
if (time?.endsWith('@')) {
|
||||
|
@ -176,12 +177,17 @@ export default {
|
|||
option = OptionReminder.DirectMessage;
|
||||
}
|
||||
|
||||
const seconds = strToSeconds(time);
|
||||
seconds = strToSeconds(time);
|
||||
await interaction.reply(`${option} - ${seconds}`);
|
||||
} else {
|
||||
// Boîte de dialogue
|
||||
seconds = 0;
|
||||
}
|
||||
|
||||
client.db.run('INSERT INTO reminder ( \
|
||||
data, expiration_date, option_id, channel_id, creation_date, user_id, guild_id \
|
||||
) VALUES ( ?, ?, ?, ?, ?, ?, ?);', [message, interaction.createdAt.getTime() + seconds, option.valueOf(), interaction.channelId, interaction.createdAt.getTime(), interaction.user.id, interaction.guildId]);
|
||||
|
||||
break;
|
||||
}
|
||||
// List reminders
|
||||
|
|
Loading…
Reference in a new issue