Skip to content

Commit

Permalink
0.7.0.2 lol
Browse files Browse the repository at this point in the history
  • Loading branch information
iLinked committed Jun 18, 2020
1 parent 7031194 commit 4a46018
Show file tree
Hide file tree
Showing 41 changed files with 150 additions and 162 deletions.
27 changes: 13 additions & 14 deletions Anarchy/Anarchy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<Compile Include="REST\Billing\PaymentMethod.cs" />
<Compile Include="REST\Billing\PaymentMethodType.cs" />
<Compile Include="REST\Billing\PayPalPaymentMethod.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordChannelIcon.cs" />
<Compile Include="REST\Gifts\DiscordGift.cs" />
<Compile Include="REST\Gifts\DiscordGiftCode.cs" />
<Compile Include="REST\Gifts\DiscordNitroGift.cs" />
Expand Down Expand Up @@ -179,15 +180,15 @@
<Compile Include="REST\CDN\DiscordCDNImage.cs" />
<Compile Include="REST\CDN\DiscordCDNImageFormat.cs" />
<Compile Include="REST\CDN\DiscordHashedCDNImage.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordAppIconCDNImage.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordDefaultUserAvatarCDNImage.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordAppIcon.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordDefaultUserAvatar.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordEmojiCDNImage.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordDiscoverySplashCDNImage.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordGuildBannerCDNImage.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordGuildIconCDNImage.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordGuildSplashCDNImage.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordTeamIconCDNImage.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordUserAvatarCDNImage.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordDiscoverySplash.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordGuildBanner.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordGuildIcon.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordGuildSplash.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordTeamIcon.cs" />
<Compile Include="REST\CDN\Endpoints\DiscordUserAvatar.cs" />
<Compile Include="REST\Channel\Channel\DiscordChannel.cs" />
<Compile Include="REST\Channel\Channel\ChannelEventArgs.cs" />
<Compile Include="REST\Channel\Channel\ChannelType.cs" />
Expand Down Expand Up @@ -268,7 +269,6 @@
<Compile Include="REST\Message\Deleted\EventArgs.cs" />
<Compile Include="REST\Message\Extensions.cs" />
<Compile Include="REST\Message\Message\Attachment.cs" />
<Compile Include="REST\Message\Message\ChannelMention.cs" />
<Compile Include="REST\Message\Message\DiscordMessage.cs" />
<Compile Include="REST\Message\Message\MessageEventArgs.cs" />
<Compile Include="REST\Message\Message\MessageFilters.cs" />
Expand All @@ -294,10 +294,10 @@
<Compile Include="REST\Guild\Permissions\DiscordPermissions.cs" />
<Compile Include="REST\RateLimit\RateLimit.cs" />
<Compile Include="REST\RateLimit\RateLimitException.cs" />
<Compile Include="REST\Relationship\Extensions.cs" />
<Compile Include="REST\Relationship\Models\Relationship.cs" />
<Compile Include="REST\Relationship\Models\RelationshipEventArgs.cs" />
<Compile Include="REST\Relationship\Models\RelationshipType.cs" />
<Compile Include="REST\Relationships\Extensions.cs" />
<Compile Include="REST\Relationships\Models\Relationship.cs" />
<Compile Include="REST\Relationships\Models\RelationshipEventArgs.cs" />
<Compile Include="REST\Relationships\Models\RelationshipType.cs" />
<Compile Include="REST\Guild\Role\Extensions.cs" />
<Compile Include="REST\Guild\Role\Models\MinimalRole.cs" />
<Compile Include="REST\Guild\Role\Models\DiscordRole.cs" />
Expand All @@ -317,7 +317,6 @@
<Compile Include="REST\User\Profile\Status.cs" />
<Compile Include="REST\User\Settings\CustomStatus.cs" />
<Compile Include="REST\User\Settings\Enums\ExplicitContentFilter.cs" />
<Compile Include="REST\User\Settings\Enums\FriendSourceFlags.cs" />
<Compile Include="REST\User\Settings\Enums\DiscordLanguage.cs" />
<Compile Include="REST\User\Settings\Enums\DiscordTheme.cs" />
<Compile Include="REST\User\Profile\UserProfileUpdate.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Anarchy/Config/DiscordConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public string UserAgent
get { return SuperProperties.UserAgent; }
set { SuperProperties.UserAgent = value; }
}
public SuperProperties SuperProperties { get; set; } = SuperProperties.FromBase64("eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRmlyZWZveCIsImRldmljZSI6IiIsImJyb3dzZXJfdXNlcl9hZ2VudCI6Ik1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjA7IFdpbjY0OyB4NjQ7IHJ2Ojc2LjApIEdlY2tvLzIwMTAwMTAxIEZpcmVmb3gvNzYuMCIsImJyb3dzZXJfdmVyc2lvbiI6Ijc2LjAiLCJvc192ZXJzaW9uIjoiMTAiLCJyZWZlcnJlciI6IiIsInJlZmVycmluZ19kb21haW4iOiIiLCJyZWZlcnJlcl9jdXJyZW50IjoiIiwicmVmZXJyaW5nX2RvbWFpbl9jdXJyZW50IjoiIiwicmVsZWFzZV9jaGFubmVsIjoic3RhYmxlIiwiY2xpZW50X2J1aWxkX251bWJlciI6NjA2NjEsImNsaWVudF9ldmVudF9zb3VyY2UiOm51bGx9");
public SuperProperties SuperProperties { get; set; } = SuperProperties.FromBase64("eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRGlzY29yZCBDbGllbnQiLCJyZWxlYXNlX2NoYW5uZWwiOiJzdGFibGUiLCJjbGllbnRfdmVyc2lvbiI6IjAuMC4zMDYiLCJvc192ZXJzaW9uIjoiMTAuMC4xODM2MiIsIm9zX2FyY2giOiJ4NjQiLCJjbGllbnRfYnVpbGRfbnVtYmVyIjo2MTkyMywiY2xpZW50X2V2ZW50X3NvdXJjZSI6bnVsbH0=");
public bool GetFingerprint { get; set; } = true;
public string ApiBaseUrl { get; set; } = "https://discord.com/api/v6";
public bool RetryOnRateLimit { get; set; } = true;
Expand Down
2 changes: 1 addition & 1 deletion Anarchy/Gateway/Auth/Models/Login.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Discord.Gateway
/// </summary>
internal class Login : ControllableEx, IDisposable
{
public Login()
internal Login()
{
OnClientUpdated += (sender, e) =>
{
Expand Down
2 changes: 1 addition & 1 deletion Anarchy/Gateway/Channel/ChannelRecipientUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public ChannelRecipientUpdate()

public MinimalChannel Channel
{
get { return new MinimalChannel(_channelId); }
get { return new MinimalChannel(_channelId).SetClient(Client); }
}
}
}
4 changes: 2 additions & 2 deletions Anarchy/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.7.0.1")]
[assembly: AssemblyFileVersion("0.7.0.1")]
[assembly: AssemblyVersion("0.7.0.2")]
[assembly: AssemblyFileVersion("0.7.0.2")]
2 changes: 1 addition & 1 deletion Anarchy/REST/Billing/Payment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Payment


[JsonProperty("status")]
public int Status { get; private set; } // not sure what htis is lol
public int Status { get; private set; } // not sure what this is lol


[JsonProperty("description")]
Expand Down
2 changes: 1 addition & 1 deletion Anarchy/REST/Billing/PaymentMethodType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public enum PaymentMethodType
{
Card = 1,
PayPal = 2
PayPal
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Discord
{
public class DiscordAppIconCDNImage : DiscordHashedCDNImage
public class DiscordAppIcon : DiscordHashedCDNImage
{
protected override string BaseEndpoint { get; set; } = "app-icons";
protected override List<DiscordCDNImageFormat> SupportedFormats { get; set; } = new List<DiscordCDNImageFormat>()
Expand All @@ -13,7 +13,7 @@ public class DiscordAppIconCDNImage : DiscordHashedCDNImage
};


public DiscordAppIconCDNImage(ulong id, string hash) : base(id, hash)
public DiscordAppIcon(ulong id, string hash) : base(id, hash)
{ }
}
}
18 changes: 18 additions & 0 deletions Anarchy/REST/CDN/Endpoints/DiscordChannelIcon.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Collections.Generic;

namespace Discord
{
public class DiscordChannelIcon : DiscordHashedCDNImage
{
protected override string BaseEndpoint { get; set; } = "channel-icons";
protected override List<DiscordCDNImageFormat> SupportedFormats { get; set; } = new List<DiscordCDNImageFormat>()
{
DiscordCDNImageFormat.PNG,
DiscordCDNImageFormat.JPG,
DiscordCDNImageFormat.WebP
};

public DiscordChannelIcon(ulong id, string hash) : base(id, hash)
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Discord
{
public class DiscordDefaultUserAvatarCDNImage : DiscordCDNImage
public class DiscordDefaultUserAvatar : DiscordCDNImage
{
protected override string BaseEndpoint { get; set; } = "embed/avatars";
protected override List<DiscordCDNImageFormat> SupportedFormats { get; set; } = new List<DiscordCDNImageFormat>()
Expand All @@ -11,7 +11,7 @@ public class DiscordDefaultUserAvatarCDNImage : DiscordCDNImage
};


public DiscordDefaultUserAvatarCDNImage(int userDiscriminator) : base(userDiscriminator % 5)
public DiscordDefaultUserAvatar(int userDiscriminator) : base(userDiscriminator % 5)
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Discord
{
public class DiscordDiscoverySplashCDNImage : DiscordHashedCDNImage
public class DiscordDiscoverySplash : DiscordHashedCDNImage
{
protected override string BaseEndpoint { get; set; } = "discovery-splashes";
protected override List<DiscordCDNImageFormat> SupportedFormats { get; set; } = new List<DiscordCDNImageFormat>()
Expand All @@ -13,7 +13,7 @@ public class DiscordDiscoverySplashCDNImage : DiscordHashedCDNImage
};


public DiscordDiscoverySplashCDNImage(ulong id, string hash) : base(id, hash)
public DiscordDiscoverySplash(ulong id, string hash) : base(id, hash)
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Discord
{
public class DiscordGuildBannerCDNImage : DiscordHashedCDNImage
public class DiscordGuildBanner : DiscordHashedCDNImage
{
protected override string BaseEndpoint { get; set; } = "banners";
protected override List<DiscordCDNImageFormat> SupportedFormats { get; set; } = new List<DiscordCDNImageFormat>()
Expand All @@ -13,7 +13,7 @@ public class DiscordGuildBannerCDNImage : DiscordHashedCDNImage
};


public DiscordGuildBannerCDNImage(ulong id, string hash) : base(id, hash)
public DiscordGuildBanner(ulong id, string hash) : base(id, hash)
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Discord
{
public class DiscordGuildIconCDNImage : DiscordHashedCDNImage
public class DiscordGuildIcon : DiscordHashedCDNImage
{
protected override string BaseEndpoint { get; set; } = "icons";
protected override List<DiscordCDNImageFormat> SupportedFormats { get; set; }


public DiscordGuildIconCDNImage(ulong id, string hash) : base(id, hash)
public DiscordGuildIcon(ulong id, string hash) : base(id, hash)
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Discord
{
public class DiscordGuildSplashCDNImage : DiscordHashedCDNImage
public class DiscordGuildSplash : DiscordHashedCDNImage
{
protected override string BaseEndpoint { get; set; } = "splashes";
protected override List<DiscordCDNImageFormat> SupportedFormats { get; set; } = new List<DiscordCDNImageFormat>()
Expand All @@ -12,7 +12,7 @@ public class DiscordGuildSplashCDNImage : DiscordHashedCDNImage
DiscordCDNImageFormat.WebP
};

public DiscordGuildSplashCDNImage(ulong id, string hash) : base(id, hash)
public DiscordGuildSplash(ulong id, string hash) : base(id, hash)
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Discord
{
public class DiscordTeamIconCDNImage : DiscordHashedCDNImage
public class DiscordTeamIcon : DiscordHashedCDNImage
{
protected override string BaseEndpoint { get; set; } = "team-icons";
protected override List<DiscordCDNImageFormat> SupportedFormats { get; set; } = new List<DiscordCDNImageFormat>()
Expand All @@ -13,7 +13,7 @@ public class DiscordTeamIconCDNImage : DiscordHashedCDNImage
};


public DiscordTeamIconCDNImage(ulong id, string hash) : base(id, hash)
public DiscordTeamIcon(ulong id, string hash) : base(id, hash)
{ }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Discord
{
public class DiscordUserAvatarCDNImage : DiscordHashedCDNImage
public class DiscordUserAvatar : DiscordHashedCDNImage
{
protected override string BaseEndpoint { get; set; } = "avatars";
protected override List<DiscordCDNImageFormat> SupportedFormats { get; set; }


public DiscordUserAvatarCDNImage(ulong id, string hash) : base(id, hash)
public DiscordUserAvatar(ulong id, string hash) : base(id, hash)
{ }
}
}
2 changes: 1 addition & 1 deletion Anarchy/REST/Channel/Private/DM/PrivateChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected void Update(PrivateChannel channel)
/// </summary>
public void Leave()
{
Update(Client.DeleteChannel(Id).ToDMChannel());
Client.DeleteChannel(Id);
}


Expand Down
43 changes: 10 additions & 33 deletions Anarchy/REST/Channel/Private/Group/Group.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ namespace Discord
public class Group : PrivateChannel
{
[JsonProperty("icon")]
public string IconId { get; private set; }
private string _iconHash;

public DiscordChannelIcon Icon
{
get
{
return new DiscordChannelIcon(Id, _iconHash);
}
}


[JsonProperty("owner_id")]
Expand All @@ -20,7 +28,7 @@ public class Group : PrivateChannel
protected void Update(Group group)
{
base.Update(group);
IconId = group.IconId;
_iconHash = group._iconHash;
OwnerId = group.OwnerId;
}

Expand Down Expand Up @@ -54,15 +62,6 @@ public void AddRecipient(ulong userId)
}


/// <summary>
/// Adds a recipient to the group
/// </summary>
public void AddRecipient(DiscordUser user)
{
AddRecipient(user.Id);
}


/// <summary>
/// Removes a user from the group
/// </summary>
Expand All @@ -82,14 +81,6 @@ public void RemoveRecipient(DiscordUser user)
}


public new void Leave()
{
Group group = Client.DeleteChannel(Id).ToGroup();

Update(group);
}


/// <summary>
/// Creates an invite
/// </summary>
Expand All @@ -98,19 +89,5 @@ public DiscordInvite CreateInvite(InviteProperties properties = null)
{
return Client.CreateInvite(Id, properties);
}


/// <summary>
/// Gets the group's icon
/// </summary>
/// <returns>The icon (null if IconId is null)</returns>
public Image GetIcon()
{
if (IconId == null)
return null;

return (Bitmap)new ImageConverter()
.ConvertFrom(new HttpClient().GetByteArrayAsync($"https://cdn.discordapp.com/icons/{Id}/{IconId}.png").Result);
}
}
}
4 changes: 2 additions & 2 deletions Anarchy/REST/Guild/Guild/BaseGuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public abstract class BaseGuild : MinimalGuild
protected string _iconId;


public DiscordGuildIconCDNImage Icon
public DiscordGuildIcon Icon
{
get
{
return new DiscordGuildIconCDNImage(Id, _iconId);
return new DiscordGuildIcon(Id, _iconId);
}
}

Expand Down
Loading

0 comments on commit 4a46018

Please sign in to comment.