Added support for removing avatars
This commit is contained in:
@@ -227,7 +227,9 @@ namespace Discord
|
|||||||
if (currentPassword == null) throw new ArgumentNullException(nameof(currentPassword));
|
if (currentPassword == null) throw new ArgumentNullException(nameof(currentPassword));
|
||||||
|
|
||||||
string avatarBase64 = null;
|
string avatarBase64 = null;
|
||||||
if (avatar != null)
|
if (avatarType == AvatarImageType.None)
|
||||||
|
avatarBase64 = "";
|
||||||
|
else if (avatar != null)
|
||||||
{
|
{
|
||||||
string base64 = Convert.ToBase64String(avatar);
|
string base64 = Convert.ToBase64String(avatar);
|
||||||
string type = avatarType == AvatarImageType.Jpeg ? "image/jpeg;base64" : "image/png;base64";
|
string type = avatarType == AvatarImageType.Jpeg ? "image/jpeg;base64" : "image/png;base64";
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ namespace Discord
|
|||||||
{
|
{
|
||||||
public enum AvatarImageType
|
public enum AvatarImageType
|
||||||
{
|
{
|
||||||
|
None,
|
||||||
Jpeg,
|
Jpeg,
|
||||||
Png
|
Png
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user