functional editing notes

This commit is contained in:
2024-08-08 18:58:45 +02:00
parent a8a38b2c04
commit 71588a1bb7
4 changed files with 449 additions and 38 deletions
@@ -59,14 +59,14 @@ public class Main {
jda.upsertCommand(Commands.slash("note", "Get a note")
.setIntegrationTypes(IntegrationType.GUILD_INSTALL, IntegrationType.USER_INSTALL)
.addOptions(
new OptionData(OptionType.STRING, "note-id", "The ID of the note", true, true),
new OptionData(OptionType.BOOLEAN, "ephermeal", "Whether the note should be ephermal", true)
new OptionData(OptionType.STRING, "alias", "The ID of the note", true, true),
new OptionData(OptionType.BOOLEAN, "ephermeal", "Whether the note should be ephermal", false)
)
.setContexts(InteractionContextType.BOT_DM, InteractionContextType.GUILD, InteractionContextType.PRIVATE_CHANNEL)
).queue();
jda.upsertCommand(Commands.slash("add-note", "Add a note")
.setIntegrationTypes(IntegrationType.GUILD_INSTALL, IntegrationType.USER_INSTALL)
.setIntegrationTypes(IntegrationType.USER_INSTALL)
.addOptions(
new OptionData(OptionType.STRING, "alias", "An alias for the note")
.setMinLength(1)
@@ -80,6 +80,10 @@ public class Main {
.setMinLength(1)
.setMaxLength(4096)
.setRequired(true),
new OptionData(OptionType.STRING, "title-url", "The image URL of the note")
.setMinLength(1)
.setMaxLength(2000)
.setRequired(false),
new OptionData(OptionType.STRING, "image-url", "The image URL of the note")
.setMinLength(1)
.setMaxLength(2000)
@@ -89,7 +93,7 @@ public class Main {
.setMaxLength(2000)
.setRequired(false),
new OptionData(OptionType.STRING, "color", "The color of the note")
.setMinLength(1)
.setMinLength(7)
.setMaxLength(7)
.setRequired(false),
new OptionData(OptionType.STRING, "author", "The author of the note")
@@ -112,6 +116,56 @@ public class Main {
.setContexts(InteractionContextType.BOT_DM)
).queue();
jda.upsertCommand(Commands.slash("edit-note", "Edit a note")
.setIntegrationTypes(IntegrationType.USER_INSTALL)
.addOptions(
new OptionData(OptionType.STRING, "alias", "An alias for the note")
.setMinLength(1)
.setMaxLength(256)
.setRequired(true),
new OptionData(OptionType.STRING, "title", "The title of the note")
.setMinLength(1)
.setMaxLength(256)
.setRequired(false),
new OptionData(OptionType.STRING, "content", "The content of the note")
.setMinLength(1)
.setMaxLength(4096)
.setRequired(false),
new OptionData(OptionType.STRING, "title-url", "The image URL of the note")
.setMinLength(1)
.setMaxLength(2000)
.setRequired(false),
new OptionData(OptionType.STRING, "image-url", "The image URL of the note")
.setMinLength(1)
.setMaxLength(2000)
.setRequired(false),
new OptionData(OptionType.STRING, "thumbnail-url", "The thumbnail URL of the note")
.setMinLength(1)
.setMaxLength(2000)
.setRequired(false),
new OptionData(OptionType.STRING, "color", "The color of the note")
.setMinLength(7)
.setMaxLength(7)
.setRequired(false),
new OptionData(OptionType.STRING, "author", "The author of the note")
.setMinLength(1)
.setMaxLength(256)
.setRequired(false),
new OptionData(OptionType.STRING, "author-url", "The author URL of the note")
.setMinLength(1)
.setMaxLength(2000)
.setRequired(false),
new OptionData(OptionType.STRING, "footer", "The footer of the note")
.setMinLength(1)
.setMaxLength(256)
.setRequired(false),
new OptionData(OptionType.STRING, "footer-url", "The footer URL of the note")
.setMinLength(1)
.setMaxLength(2000)
.setRequired(false)
)
.setContexts(InteractionContextType.BOT_DM)
).queue();
}
private static void loadProperties() {