#pragma once
 
#include "HelperFunctions.hpp"
 
 
      public:
        register_application_commands() {
            commandName = "registerapplicationcommands";
            helpDescription = "register some application commands.";
            embed_data msgEmbed;
            msgEmbed.setDescription("------\nSimply enter /register_application_commandsn------");
            msgEmbed.setTitle("__**register slash commands usage:**__");
            msgEmbed.setTimeStamp(getTimeAndDate());
            msgEmbed.setColor("fe_fe_fe");
            helpEmbed = msgEmbed;
        }
 
        unique_ptr<base_function> create() {
            return makeUnique<register_application_commands>();
        }
 
        virtual void execute(base_function_arguments& argsNew) {
            try {
 
                bool areWeInADm = areWeInADM(argsNew.eventData, channel);
 
                if (areWeInADm) {
                    return;
                }
 
                input_events::deleteInputEventResponseAsync(argsNew.eventData).get();
 
                respond_to_input_event_data& dataPackage(argsNew.eventData);
                dataPackage.setResponseType(input_event_response_type::Deferred_Response);
                auto newEvent = input_events::respondToInputEventAsync(dataPackage).get();
                
                create_global_application_command_data registerApplicationCommandsCommandData;
                registerApplicationCommandsCommandData.dmPermission = true;
                registerApplicationCommandsCommandData.applicationId = discord_core_client::getInstance()->getBotUser().id;
                registerApplicationCommandsCommandData.type = application_command_type::Chat_Input;
                registerApplicationCommandsCommandData.description = "register the programmatically designated slash commands.";
                registerApplicationCommandsCommandData.name = "registerapplicationcommands";
                application_commands::createGlobalApplicationCommandAsync(registerApplicationCommandsCommandData);
 
                create_global_application_command_data createTestData;
                createTestData.dmPermission = true;
                createTestData.applicationId = discord_core_client::getInstance()->getBotUser().id;
                createTestData.type = application_command_type::Chat_Input;
                createTestData.name = "test";
                createTestData.description = "test command.";
                application_commands::createGlobalApplicationCommandAsync(createTestData).get();
 
                embed_data msgEmbed;
                msgEmbed.setAuthor(argsNew.eventData.getUserName(), argsNew.eventData.getAvatarUrl());
                msgEmbed.setColor("fefefe");
                msgEmbed.setDescription("------\nNicely done, you've registered some commands!\n------");
                msgEmbed.setTitle("__**register application commands complete:**__");
                respond_to_input_event_data responseData(newEvent);
                responseData.setResponseType(input_event_response_type::Edit_Interaction_Response);
                responseData.addMessageEmbed(msgEmbed);
                auto event = input_events::respondToInputEventAsync(responseData).get();
                return;
            } catch (...) {
                reportException("register_application_commands::execute()");
            }
        }
        virtual ~register_application_commands(){};
    };
}
static channel_cache_data getCachedChannel(get_channel_data dataPackage)
Collects a channel from the library's cache.
DiscordCoreAPI_Dll jsonifier::string getTimeAndDate()
Acquires a timeStamp with the current time and date - suitable for use in message-embeds.
The main namespace for the forward-facing interfaces.
Base class for the command classes.