From 752853be3a3079491959f7af1243171f93ed765c Mon Sep 17 00:00:00 2001 From: yaansz Date: Sat, 28 Oct 2023 13:57:14 -0300 Subject: [PATCH] feat: adding calendar interface --- .../softawii/capivara/core/DroneManager.java | 1 + .../capivara/listeners/CalendarGroup.java | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/main/java/com/softawii/capivara/listeners/CalendarGroup.java diff --git a/src/main/java/com/softawii/capivara/core/DroneManager.java b/src/main/java/com/softawii/capivara/core/DroneManager.java index b1db2b7..d88af94 100644 --- a/src/main/java/com/softawii/capivara/core/DroneManager.java +++ b/src/main/java/com/softawii/capivara/core/DroneManager.java @@ -39,6 +39,7 @@ import java.awt.*; import java.util.ArrayList; import java.util.Collection; +import java.util.Objects; import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/src/main/java/com/softawii/capivara/listeners/CalendarGroup.java b/src/main/java/com/softawii/capivara/listeners/CalendarGroup.java new file mode 100644 index 0000000..278d29b --- /dev/null +++ b/src/main/java/com/softawii/capivara/listeners/CalendarGroup.java @@ -0,0 +1,41 @@ +package com.softawii.capivara.listeners; + +import com.softawii.curupira.annotations.IArgument; +import com.softawii.curupira.annotations.ICommand; +import com.softawii.curupira.annotations.IGroup; +import net.dv8tion.jda.api.Permission; +import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent; +import net.dv8tion.jda.api.interactions.commands.OptionType; + +@IGroup(name = "Calendar", description = "Calendar events", hidden = false) +public class CalendarGroup { + + @ICommand(name = "Subscribe", description = "Subscribe to a Google Calendar", permissions = {Permission.ADMINISTRATOR}) + @IArgument(name = "Calendar ID", description = "The ID of the calendar to subscribe to", required = true) + @IArgument(name = "Name", description = "The name to use for the calendar", required = true) + @IArgument(name = "Channel", description = "The channel where events will be announced", required = true, type = OptionType.CHANNEL) + @IArgument(name = "Role", description = "The role to be pinged when events begin", required = false, type = OptionType.ROLE) + public static void subscribe(SlashCommandInteractionEvent event) { + event.reply("Not implemented yet").queue(); + } + + @ICommand(name = "Unsubscribe", description = "Unsubscribe from a Google Calendar", permissions = {Permission.ADMINISTRATOR}) + @IArgument(name = "Name", description = "The name to use for the calendar", required = true) + public static void unsubscribe(SlashCommandInteractionEvent event) { + event.reply("Not implemented yet").queue(); + } + + @ICommand(name = "list", description = "List all events from a Google Calendar") + @IArgument(name = "Name", description = "The name to use for the calendar", required = false) + public static void list(SlashCommandInteractionEvent event) { + event.reply("Not implemented yet").queue(); + } + + @ICommand(name = "Update", description = "Update configuration of a calendar", permissions = {Permission.ADMINISTRATOR}) + @IArgument(name = "Name", description = "The name to use for the calendar", required = true) + @IArgument(name = "Channel", description = "The channel where events will be announced", required = true, type = OptionType.CHANNEL) + @IArgument(name = "Role", description = "The role to be pinged when events begin", required = false, type = OptionType.ROLE) + public static void update(SlashCommandInteractionEvent event) { + event.reply("Not implemented yet").queue(); + } +}