|
|
|
@ -580,7 +580,7 @@ func main() {
|
|
|
|
|
return nil
|
|
|
|
|
},
|
|
|
|
|
"schedule": func(ctx context.Context, s *discordgo.Session, i *discordgo.InteractionCreate) error {
|
|
|
|
|
// get schedule from now to 4 mondays into the future
|
|
|
|
|
// get schedule from now to 4 wednesdays into the future
|
|
|
|
|
sched, err := store.GetSchedule(ctx, themis.NextWednesday(), themis.NextWednesday().Add(4*7*24*time.Hour))
|
|
|
|
|
if err != nil {
|
|
|
|
|
if err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
|
|
|
@ -675,17 +675,17 @@ func main() {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if date.Weekday() != time.Monday {
|
|
|
|
|
if date.Weekday() != time.Wednesday {
|
|
|
|
|
if err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
|
|
|
|
|
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
|
|
|
|
Data: &discordgo.InteractionResponseData{
|
|
|
|
|
Flags: discordgo.MessageFlagsEphemeral,
|
|
|
|
|
Content: "The date you provided is not a Monday.",
|
|
|
|
|
Content: "The date you provided is not a Wednesday.",
|
|
|
|
|
},
|
|
|
|
|
}); err != nil {
|
|
|
|
|
return fmt.Errorf("failed to respond to interaction: %w", err)
|
|
|
|
|
}
|
|
|
|
|
// TODO(wperron) suggest Mondays before and after?
|
|
|
|
|
// TODO(wperron) suggest Wednesdays before and after?
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -753,7 +753,7 @@ func main() {
|
|
|
|
|
var msg string
|
|
|
|
|
var components []discordgo.MessageComponent
|
|
|
|
|
if len(absentees) == 0 {
|
|
|
|
|
msg = "Everybody can make it next Monday, see you then! 🎉"
|
|
|
|
|
msg = "Everybody can make it next Wednesday, see you then! 🎉"
|
|
|
|
|
components = []discordgo.MessageComponent{
|
|
|
|
|
discordgo.ActionsRow{
|
|
|
|
|
Components: []discordgo.MessageComponent{
|
|
|
|
@ -770,7 +770,7 @@ func main() {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
msg = fmt.Sprintf("%s can't make it next Monday. 🙁", themis.FormatStringSlice(absentees))
|
|
|
|
|
msg = fmt.Sprintf("%s can't make it next Wednesday. 🙁", themis.FormatStringSlice(absentees))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_, err = discord.ChannelMessageSendComplex(channelId, &discordgo.MessageSend{
|
|
|
|
|