Add support for attachments (#2088)
* Enforce valid button styles * support command option type 11 * missing '.' * Added type converter. Co-authored-by: Cat <lumitydev@gmail.com> Co-authored-by: CottageDwellingCat <80918250+CottageDwellingCat@users.noreply.github.com> Co-authored-by: FeroxFoxxo <feroxfoxxo@gmail.com> Co-authored-by: Cat <lumitydev@gmail.com> Co-authored-by: CottageDwellingCat <80918250+CottageDwellingCat@users.noreply.github.com>
This commit is contained in:
@@ -163,6 +163,7 @@ namespace Discord.Interactions
|
||||
{
|
||||
[typeof(IChannel)] = typeof(DefaultChannelConverter<>),
|
||||
[typeof(IRole)] = typeof(DefaultRoleConverter<>),
|
||||
[typeof(IAttachment)] = typeof(DefaultAttachmentConverter<>),
|
||||
[typeof(IUser)] = typeof(DefaultUserConverter<>),
|
||||
[typeof(IMentionable)] = typeof(DefaultMentionableConverter<>),
|
||||
[typeof(IConvertible)] = typeof(DefaultValueConverter<>),
|
||||
|
||||
@@ -20,6 +20,11 @@ namespace Discord.Interactions
|
||||
}
|
||||
}
|
||||
|
||||
internal class DefaultAttachmentConverter<T> : DefaultEntityTypeConverter<T> where T : class, IAttachment
|
||||
{
|
||||
public override ApplicationCommandOptionType GetDiscordType() => ApplicationCommandOptionType.Attachment;
|
||||
}
|
||||
|
||||
internal class DefaultRoleConverter<T> : DefaultEntityTypeConverter<T> where T : class, IRole
|
||||
{
|
||||
public override ApplicationCommandOptionType GetDiscordType ( ) => ApplicationCommandOptionType.Role;
|
||||
|
||||
Reference in New Issue
Block a user