From 23ed4a7d9688eb6d1a7f7108cd2d5e6bec262792 Mon Sep 17 00:00:00 2001 From: Will Brown Date: Sun, 24 Nov 2024 23:36:43 -0500 Subject: [PATCH] [main.c] Make the list command return a basic embed --- main.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index bb6c04b..2d0d6b0 100644 --- a/main.c +++ b/main.c @@ -34,6 +34,9 @@ struct bot_command { #define _CREATE_OPTIONS(options) &(struct discord_application_command_options) { .size = sizeof((struct discord_application_command_option[]) options) / sizeof(struct discord_application_command_option), .array = (struct discord_application_command_option[]) options } #define CREATE_OPTIONS(...) _CREATE_OPTIONS(P99_PROTECT(__VA_ARGS__)) +#define _CREATE_EMBEDS(embeds) &(struct discord_embeds) { .size = sizeof((struct discord_embed[]) embeds) / sizeof(struct discord_embed), .array = (struct discord_embed[]) embeds } +#define CREATE_EMBEDS(...) _CREATE_EMBEDS(P99_PROTECT(__VA_ARGS__)) + #define BOT_COMMAND_NOT_IMPLEMENTED() do { \ struct discord_interaction_response res = { \ .type = DISCORD_INTERACTION_CHANNEL_MESSAGE_WITH_SOURCE, \ @@ -286,7 +289,20 @@ static void bot_command_remove(struct discord *client, const struct discord_inte } static void bot_command_list(struct discord *client, const struct discord_interaction *event) { - BOT_COMMAND_NOT_IMPLEMENTED(); + struct discord_interaction_response res = { + .type = DISCORD_INTERACTION_CHANNEL_MESSAGE_WITH_SOURCE, + .data = &(struct discord_interaction_callback_data) { + .embeds = CREATE_EMBEDS({ + { + .title = "Feed List", + .type = "rich", + .description = "List functionality has not been fully implemented yet." + } + }) + } + }; + + discord_create_interaction_response(client, event->id, event->token, &res, NULL); } static void bot_command_help(struct discord *client, const struct discord_interaction *event) {