You can not select more than 25 topicsTopics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
Interactions are the base thing sent over by Discord. Slash commands are one of the interaction types. We can listen to the SlashCommandExecuted event to respond to them. Lets add this to our code:
With every type of interaction there is a Data field. This is where the relevant information lives about our command that was executed. In our case, Data is a SocketSlashCommandData instance. In the data class, we can access the name of the command triggered as well as the options if there were any. For this example, we're just going to respond with the name of the command executed.
[!NOTE]
After receiving an interaction, you must respond to acknowledge it. You can choose to respond with a message immediately using RespondAsync() or you can choose to send a deferred response with DeferAsync().
If choosing a deferred response, the user will see a loading state for the interaction, and you'll have up to 15 minutes to edit the original deferred response using ModifyOriginalResponseAsync(). You can read more about response types here
This seems to be working! Next, we will look at parameters for slash commands.
Please read the following content carefully:
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.