feature: V2 Permissions (#2222)
* Initial V2 permissions * add perms-v2 attributes and properties, add deprecation messages * add perms-v2 properties to command info classes * add perms-v2 fields to Rest/SocketApplicationCommand entities and IApplicationCommand * fix json name of DmPermission field Co-authored-by: Cenngo <cenk.ergen1@gmail.com>
This commit is contained in:
@@ -100,7 +100,12 @@ namespace Discord.Rest
|
||||
Type = arg.Type,
|
||||
DefaultPermission = arg.IsDefaultPermission.IsSpecified
|
||||
? arg.IsDefaultPermission.Value
|
||||
: Optional<bool>.Unspecified
|
||||
: Optional<bool>.Unspecified,
|
||||
|
||||
// TODO: better conversion to nullable optionals
|
||||
DefaultMemberPermission = arg.DefaultMemberPermissions.ToNullable(),
|
||||
DmPermission = arg.IsDMEnabled.ToNullable()
|
||||
|
||||
};
|
||||
|
||||
if (arg is SlashCommandProperties slashProps)
|
||||
@@ -134,7 +139,11 @@ namespace Discord.Rest
|
||||
Type = arg.Type,
|
||||
DefaultPermission = arg.IsDefaultPermission.IsSpecified
|
||||
? arg.IsDefaultPermission.Value
|
||||
: Optional<bool>.Unspecified
|
||||
: Optional<bool>.Unspecified,
|
||||
|
||||
// TODO: better conversion to nullable optionals
|
||||
DefaultMemberPermission = arg.DefaultMemberPermissions.ToNullable(),
|
||||
DmPermission = arg.IsDMEnabled.ToNullable()
|
||||
};
|
||||
|
||||
if (arg is SlashCommandProperties slashProps)
|
||||
@@ -171,7 +180,11 @@ namespace Discord.Rest
|
||||
Type = arg.Type,
|
||||
DefaultPermission = arg.IsDefaultPermission.IsSpecified
|
||||
? arg.IsDefaultPermission.Value
|
||||
: Optional<bool>.Unspecified
|
||||
: Optional<bool>.Unspecified,
|
||||
|
||||
// TODO: better conversion to nullable optionals
|
||||
DefaultMemberPermission = arg.DefaultMemberPermissions.ToNullable(),
|
||||
DmPermission = arg.IsDMEnabled.ToNullable()
|
||||
};
|
||||
|
||||
if (arg is SlashCommandProperties slashProps)
|
||||
@@ -285,7 +298,11 @@ namespace Discord.Rest
|
||||
Type = arg.Type,
|
||||
DefaultPermission = arg.IsDefaultPermission.IsSpecified
|
||||
? arg.IsDefaultPermission.Value
|
||||
: Optional<bool>.Unspecified
|
||||
: Optional<bool>.Unspecified,
|
||||
|
||||
// TODO: better conversion to nullable optionals
|
||||
DefaultMemberPermission = arg.DefaultMemberPermissions.ToNullable(),
|
||||
DmPermission = arg.IsDMEnabled.ToNullable()
|
||||
};
|
||||
|
||||
if (arg is SlashCommandProperties slashProps)
|
||||
|
||||
Reference in New Issue
Block a user