@@ -3,6 +3,7 @@ import { commandTypeHelpers as ct } from "../../../commandTypes.js";
33import { registerUpcomingReminder } from "../../../data/loops/upcomingRemindersLoop.js" ;
44import { humanizeDuration } from "../../../humanizeDuration.js" ;
55import { convertDelayStringToMS , messageLink } from "../../../utils.js" ;
6+ import { parseDiscordTimestampToMS } from "../../../utils/parseDiscordTimestampToMS.js" ;
67import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js" ;
78import { remindersCmd } from "../types.js" ;
89
@@ -34,14 +35,19 @@ export const RemindCmd = remindersCmd({
3435 // Date and time in YYYY-MM-DD[T]HH:mm format
3536 reminderTime = moment . tz ( args . time , "YYYY-M-D[T]HH:mm" , tz ) . second ( 0 ) ;
3637 } else {
37- // "Delay string" i.e. e.g. "2h30m"
38- const ms = convertDelayStringToMS ( args . time ) ;
39- if ( ms === null ) {
40- void pluginData . state . common . sendErrorMessage ( msg , "Invalid reminder time" ) ;
41- return ;
42- }
38+ const timestampMs = parseDiscordTimestampToMS ( args . time ) ;
39+ if ( timestampMs !== null ) {
40+ reminderTime = moment . utc ( timestampMs ) ;
41+ } else {
42+ // "Delay string" i.e. e.g. "2h30m"
43+ const ms = convertDelayStringToMS ( args . time ) ;
44+ if ( ms === null ) {
45+ void pluginData . state . common . sendErrorMessage ( msg , "Invalid reminder time" ) ;
46+ return ;
47+ }
4348
44- reminderTime = moment . utc ( ) . add ( ms , "millisecond" ) ;
49+ reminderTime = moment . utc ( ) . add ( ms , "millisecond" ) ;
50+ }
4551 }
4652
4753 if ( ! reminderTime . isValid ( ) || reminderTime . isBefore ( now ) ) {
0 commit comments