* Update README.md
* Update README.md
* Fix SocketSlashCommandDataOption to use long for Number instead of int (#89)
* Application webhooks (#86)
* Added webhook components for hooks having an application ID.
* resolved#88
* resolved#85
* Update device for gateway
* Fix MessageProperties.Embed being ignored in some methods that modifies a message (#92)
* Update label/description lengths for selects (ref: https://github.com/discord/discord-api-docs/pull/3598/files) (#91)
https://github.com/discord/discord-api-docs/pull/3598/files
* Fix tests (#90)
* Fix gateway serialization to include nulls (#96)
* Add missing guild permissions (#93)
* Update GuildPermissions.cs
* Update GuildPermissionsTests.cs
* Add banner and accent color to user and some fixes/improvements (#81)
* Add banner and accent color to user and some fixes
* Fix
* Fix!
* increase size of user banners to 256
* Some changes and mini refactor of color class
* add constant maxDecimalValue to color and checks with exceptions
* add `NotSupportedException` for `BannerId` and `AccentColor` in `SocketWebhookUser`
* Update ComponentBuilder.cs
- `MaxLabelLength` from `ComponentBuilder` moved to `ButtonBuilder`
- Added `MaxLabelLength` for `SelectMenuOptionBuilder`
- Changed `MaxDescriptionLength` to 100
* Interface Method Declarations for Interaction Methods (#99)
* added interface method declarations
* inline docs
* Fix serialization error
* meta: bump versions
* Fix debug pragma
* meta: bump version
* Remove rich presence button
* Assign CurrentUserId in Sharded Client (#100)
* added interface method declarations
* inline docs
* current user id assignment in sharded client
* Allow EmbedBuilder.ImageUrl to use attachment scheme syntax (#104)
* Make Webhook ApplicationId nullable instead of optional + fix IDiscordInteraction DeferAsync method (#110)
* Make Webhook ApplicationId nullable instead of optional
* Fix IDiscordInteraction DeferAsync to account for ephemeral defer
* Fix application command and thread starter messages being created as SocketSystemMessage
* Added description of ApplicationCommandType Enums
* Requested Fixes
renamed SocketApplicationUserCommand to SocketUserCommand
renamed SocketApplicationMessageCommand to SocketMessageCommand
using ContextMenuCreationProperties for both User and Message commands
* Added Summary to public members
removed whitespace from DiscordRestApiClient.cs
* Fixing guide to use switch statement
* implemented TrySendApplicationCommandAsync
* implemented ephemeral in SocketCommandBase Defer, and RespondAsync.
assigning int 64 was error. changed to "MessageFlags.Ephemeral", built and tested to work.
* removed ApplicationCommandType from SocketUser and SocketMessageCommandData
Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
Co-authored-by: František Boháček <fandabohacek@gmail.com>
Co-authored-by: quin lynch <lynchquin@gmail.com>
Co-authored-by: d4n3436 <dan3436@hotmail.com>
Co-authored-by: MrCakeSlayer <13650699+MrCakeSlayer@users.noreply.github.com>
Co-authored-by: Nikon <47792796+INikonI@users.noreply.github.com>
Co-authored-by: Cenk Ergen <57065323+Cenngo@users.noreply.github.com>
The base command model that belongs to an application. see <see href="https://discord.com/developers/docs/interactions/slash-commands#applicationcommand"/>
The base command model that belongs to an application. see <see href="https://discord.com/developers/docs/interactions/slash-commands#applicationcommand"/>
@@ -4502,13 +4559,6 @@
If the option is a subcommand or subcommand group type, this nested options will be the parameters.
If the option is a subcommand or subcommand group type, this nested options will be the parameters.
Represents data of an Interaction Command, see <see href="https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondata"/>.
Represents data of an Interaction Command, see <see href="https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondata"/>.
Responds to an Interaction with type <see cref="F:Discord.InteractionResponseType.ChannelMessageWithSource"/>.
</summary>
<param name="text">The text of the message to be sent.</param>
<param name="embeds">A array of embeds to send with this response. Max 10</param>
<param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
<param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
<param name="allowedMentions">The allowed mentions for this response.</param>
<param name="options">The request options for this response.</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response</param>
<param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
<param name="text">The text of the message to be sent</param>
<param name="embeds">A array of embeds to send with this response. Max 10</param>
<param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
<param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
<param name="allowedMentions">The allowed mentions for this response.</param>
<param name="options">The request options for this response.</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response</param>
<param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
This property will be added to the <see cref="P:Discord.MessageProperties.Embed"/> array, in the future please use the array rather then this property.
This property will be added to the <see cref="P:Discord.MessageProperties.Embeds"/> array, in the future please use the array rather than this property.
/// The base command model that belongs to an application. see <see href="https://discord.com/developers/docs/interactions/slash-commands#applicationcommand"/>
/// The base command model that belongs to an application. see <see href="https://discord.com/developers/docs/interactions/slash-commands#applicationcommand"/>
/// </summary>
/// </summary>
public interface IApplicationCommand : ISnowflakeEntity
public interface IApplicationCommand : ISnowflakeEntity, IDeletable
{
{
/// <summary>
/// <summary>
/// Gets the unique id of the parent application.
/// Gets the unique id of the parent application.
@@ -40,12 +40,5 @@ namespace Discord
/// If the option is a subcommand or subcommand group type, this nested options will be the parameters.
/// If the option is a subcommand or subcommand group type, this nested options will be the parameters.
/// Responds to an Interaction with type <see cref="InteractionResponseType.ChannelMessageWithSource"/>.
/// </summary>
/// <param name="text">The text of the message to be sent.</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10</param>
/// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
/// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
/// <param name="allowedMentions">The allowed mentions for this response.</param>
/// <param name="options">The request options for this response.</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response</param>
/// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
/// Sends a followup message for this interaction.
/// </summary>
/// <param name="text">The text of the message to be sent</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10</param>
/// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
/// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
/// <param name="allowedMentions">The allowed mentions for this response.</param>
/// <param name="options">The request options for this response.</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response</param>
/// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
// New flags prop. this make the response "ephemeral". see https://discord.com/developers/docs/interactions/slash-commands#interaction-response-interactionapplicationcommandcallbackdata
// New flags prop. this make the response "ephemeral". see https://discord.com/developers/docs/interactions/slash-commands#interaction-response-interactionapplicationcommandcallbackdata
[JsonProperty("flags")]
[JsonProperty("flags")]
public Optional<int> Flags { get; set; }
public Optional<MessageFlags> Flags { get; set; }
[JsonProperty("components")]
[JsonProperty("components")]
public Optional<API.ActionRowComponent[]> Components { get; set; }
public Optional<API.ActionRowComponent[]> Components { get; set; }
src/Discord.Net.WebSocket/Entities/Interaction/Context Menu Commands/Message Commands/SocketApplicationMessageCommand.cs → src/Discord.Net.WebSocket/Entities/Interaction/Context Menu Commands/Message Commands/SocketMessageCommand.csView File
@@ -10,14 +10,14 @@ namespace Discord.WebSocket
/// <summary>
/// <summary>
/// Represents a Websocket-based slash command received over the gateway.
/// Represents a Websocket-based slash command received over the gateway.
/// </summary>
/// </summary>
public class SocketApplicationMessageCommand : SocketCommandBase
public class SocketMessageCommand : SocketCommandBase
{
{
/// <summary>
/// <summary>
/// The data associated with this interaction.
/// The data associated with this interaction.
/// </summary>
/// </summary>
new public SocketApplicationMessageCommandData Data { get; }
new public SocketMessageCommandData Data { get; }
internal SocketApplicationMessageCommand(DiscordSocketClient client, Model model, ISocketMessageChannel channel)
internal SocketMessageCommand(DiscordSocketClient client, Model model, ISocketMessageChannel channel)
: base(client, model, channel)
: base(client, model, channel)
{
{
var dataModel = model.Data.IsSpecified ?
var dataModel = model.Data.IsSpecified ?
@@ -28,12 +28,12 @@ namespace Discord.WebSocket
if (this.Channel is SocketGuildChannel guildChannel)
if (this.Channel is SocketGuildChannel guildChannel)
guildId = guildChannel.Guild.Id;
guildId = guildChannel.Guild.Id;
Data = SocketApplicationMessageCommandData.Create(client, dataModel, model.Id, guildId);
Data = SocketMessageCommandData.Create(client, dataModel, model.Id, guildId);
}
}
new internal static SocketInteraction Create(DiscordSocketClient client, Model model, ISocketMessageChannel channel)
new internal static SocketInteraction Create(DiscordSocketClient client, Model model, ISocketMessageChannel channel)
{
{
var entity = new SocketApplicationMessageCommand(client, model, channel);
var entity = new SocketMessageCommand(client, model, channel);
entity.Update(model);
entity.Update(model);
return entity;
return entity;
}
}
src/Discord.Net.WebSocket/Entities/Interaction/Context Menu Commands/Message Commands/SocketApplicationMessageCommandData.cs → src/Discord.Net.WebSocket/Entities/Interaction/Context Menu Commands/Message Commands/SocketMessageCommandData.csView File
@@ -6,12 +6,15 @@ using Model = Discord.API.ApplicationCommandInteractionData;
namespace Discord.WebSocket
namespace Discord.WebSocket
{
{
/// <summary>
/// <summary>
/// Represents the data tied with the <see cref="SocketApplicationMessageCommand"/> interaction.
/// Represents the data tied with the <see cref="SocketMessageCommand"/> interaction.
/// </summary>
/// </summary>
public class SocketApplicationMessageCommandData : SocketEntity<ulong>, IApplicationCommandInteractionData
public class SocketMessageCommandData : SocketEntity<ulong>, IApplicationCommandInteractionData
{
{
/// <inheritdoc/>
/// <inheritdoc/>
public string Name { get; private set; }
public string Name { get; private set; }
/// <summary>
/// The message selected to run the command
/// </summary>
public SocketMessage Message { get; private set; }
public SocketMessage Message { get; private set; }
var entity = new SocketApplicationMessageCommandData(client, model, guildId);
var entity = new SocketMessageCommandData(client, model, guildId);
entity.Update(model);
entity.Update(model);
return entity;
return entity;
}
}
src/Discord.Net.WebSocket/Entities/Interaction/Context Menu Commands/User Commands/SocketApplicationUserCommand.cs → src/Discord.Net.WebSocket/Entities/Interaction/Context Menu Commands/User Commands/SocketUserCommand.csView File
@@ -10,14 +10,14 @@ namespace Discord.WebSocket
/// <summary>
/// <summary>
/// Represents a Websocket-based slash command received over the gateway.
/// Represents a Websocket-based slash command received over the gateway.
/// </summary>
/// </summary>
public class SocketApplicationUserCommand : SocketCommandBase
public class SocketUserCommand : SocketCommandBase
{
{
/// <summary>
/// <summary>
/// The data associated with this interaction.
/// The data associated with this interaction.
/// </summary>
/// </summary>
new public SocketApplicationUserCommandData Data { get; }
new public SocketUserCommandData Data { get; }
internal SocketApplicationUserCommand(DiscordSocketClient client, Model model, ISocketMessageChannel channel)
internal SocketUserCommand(DiscordSocketClient client, Model model, ISocketMessageChannel channel)
: base(client, model, channel)
: base(client, model, channel)
{
{
var dataModel = model.Data.IsSpecified ?
var dataModel = model.Data.IsSpecified ?
@@ -28,12 +28,12 @@ namespace Discord.WebSocket
if (this.Channel is SocketGuildChannel guildChannel)
if (this.Channel is SocketGuildChannel guildChannel)
guildId = guildChannel.Guild.Id;
guildId = guildChannel.Guild.Id;
Data = SocketApplicationUserCommandData.Create(client, dataModel, model.Id, guildId);
Data = SocketUserCommandData.Create(client, dataModel, model.Id, guildId);
}
}
new internal static SocketInteraction Create(DiscordSocketClient client, Model model, ISocketMessageChannel channel)
new internal static SocketInteraction Create(DiscordSocketClient client, Model model, ISocketMessageChannel channel)
{
{
var entity = new SocketApplicationUserCommand(client, model, channel);
var entity = new SocketUserCommand(client, model, channel);
entity.Update(model);
entity.Update(model);
return entity;
return entity;
}
}
src/Discord.Net.WebSocket/Entities/Interaction/Context Menu Commands/User Commands/SocketApplicationUserCommandData.cs → src/Discord.Net.WebSocket/Entities/Interaction/Context Menu Commands/User Commands/SocketUserCommandData.csView File
@@ -6,13 +6,15 @@ using Model = Discord.API.ApplicationCommandInteractionData;
namespace Discord.WebSocket
namespace Discord.WebSocket
{
{
/// <summary>
/// <summary>
/// Represents the data tied with the <see cref="SocketApplicationUserCommand"/> interaction.
/// Represents the data tied with the <see cref="SocketUserCommand"/> interaction.
/// </summary>
/// </summary>
public class SocketApplicationUserCommandData : SocketEntity<ulong>, IApplicationCommandInteractionData
public class SocketUserCommandData : SocketEntity<ulong>, IApplicationCommandInteractionData
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.