Skip to content

Commit

Permalink
woohoo 0.7.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
iLinked committed Jun 26, 2020
1 parent 2e3d4c5 commit 543293e
Show file tree
Hide file tree
Showing 80 changed files with 86 additions and 2,298 deletions.
16 changes: 0 additions & 16 deletions Anarchy.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,6 @@ Global
{7F6F1AAC-E4DC-4FE7-8166-5B7AEC6FEB4C}.ReleaseLibs|Any CPU.ActiveCfg = Debug|Any CPU
{7F6F1AAC-E4DC-4FE7-8166-5B7AEC6FEB4C}.ReleaseLibs|x64.ActiveCfg = Debug|Any CPU
{7F6F1AAC-E4DC-4FE7-8166-5B7AEC6FEB4C}.ReleaseLibs|x64.Build.0 = Debug|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Debug|x64.ActiveCfg = Debug|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Debug|x64.Build.0 = Debug|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Release Examples|Any CPU.ActiveCfg = Release|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Release Examples|Any CPU.Build.0 = Release|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Release Examples|x64.ActiveCfg = Release|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Release Examples|x64.Build.0 = Release|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Release|Any CPU.Build.0 = Release|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Release|x64.ActiveCfg = Release|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.Release|x64.Build.0 = Release|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.ReleaseLibs|Any CPU.ActiveCfg = Release|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.ReleaseLibs|Any CPU.Build.0 = Release|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.ReleaseLibs|x64.ActiveCfg = Release|Any CPU
{63C6E908-2D28-4625-95B5-DE80338D6E5B}.ReleaseLibs|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
7 changes: 2 additions & 5 deletions Anarchy/Anarchy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@
<Compile Include="Gateway\Guild\Models\MemberList\MemberListQueryOptions.cs" />
<Compile Include="Gateway\Guild\Models\UnavailableGuild.cs" />
<Compile Include="Gateway\Guild\Models\GuildUnavailableEventArgs.cs" />
<Compile Include="Gateway\Intents\DiscordGatewayIntent.cs" />
<Compile Include="Gateway\Intents\DiscordGatewayIntents.cs" />
<Compile Include="Gateway\Intents\GatewayIntentCalculator.cs" />
<Compile Include="Gateway\Auth\Session\DiscordGatewayIntent.cs" />
<Compile Include="Gateway\Invite\InviteDeletedEventArgs.cs" />
<Compile Include="Gateway\Presence\Activity\User\UserActivity.cs" />
<Compile Include="Gateway\Presence\Activity\User\UserCustomStatusActivity.cs" />
Expand Down Expand Up @@ -198,8 +196,7 @@
<Compile Include="REST\Channel\Channel\IMessageChannel.cs" />
<Compile Include="REST\Channel\Channel\MinimalChannel.cs" />
<Compile Include="REST\Channel\Guild\Text\MinimalTextChannel.cs" />
<Compile Include="REST\Channel\Channel\Properties\ChannelProperties.cs" />
<Compile Include="REST\Channel\Channel\Properties\CreationProperties.cs" />
<Compile Include="REST\Channel\Channel\CreationProperties.cs" />
<Compile Include="REST\Channel\Guild\Extensions.cs" />
<Compile Include="REST\Channel\Guild\Guild\CreationProperties.cs" />
<Compile Include="REST\Channel\Guild\Guild\GuildChannel.cs" />
Expand Down
3 changes: 1 addition & 2 deletions Anarchy/Config/DiscordSocketConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
public class DiscordSocketConfig : DiscordConfig
{
public bool ConnectToVoiceChannels { get; set; } = true;
public bool GuildSubscriptions { get; set; } = true;
public bool Cache { get; set; } = true;
internal DiscordGatewayIntents Intents { get; set; } = new DiscordGatewayIntents(GatewayIntentCalculator.All());
public DiscordGatewayIntent? Intents { get; set; }
}
}
4 changes: 2 additions & 2 deletions Anarchy/DiscordSocketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ private void SocketDataReceived(object sender, WebSocketSharp.MessageEventArgs r
switch (payload.Opcode)
{
case GatewayOpcode.Event:
/*
Console.WriteLine(payload.Title);

Console.WriteLine(payload.Title);
/*
File.AppendAllText("Debug.log", $"{payload.Title}: {payload.Data}\n");*/

switch (payload.Title)
Expand Down
3 changes: 1 addition & 2 deletions Anarchy/Gateway/Auth/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ internal static void LoginToGateway(this DiscordSocketClient client)
{
Token = client.Token,
Properties = client.Config.SuperProperties,
GuildSubscriptions = client.Config.GuildSubscriptions,
//Intents = client.Config.Intents.Intents
Intents = client.Config.Intents
};

client.Send(GatewayOpcode.Identify, identification);
Expand Down
14 changes: 8 additions & 6 deletions Anarchy/Gateway/Auth/Models/Identification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ internal class GatewayIdentification
public bool Compress { get; set; }


[JsonProperty("guild_subscriptions")]
public bool GuildSubscriptions { get; set; }

/*
[JsonProperty("intents")]
public DiscordGatewayIntent Intents { get; set; }
*/
public DiscordGatewayIntent? Intents { get; set; }


public bool ShouldSerializeIntents()
{
return Intents.HasValue;
}


public override string ToString()
{
Expand Down
1 change: 0 additions & 1 deletion Anarchy/Gateway/Guild/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;

Expand Down
30 changes: 0 additions & 30 deletions Anarchy/Gateway/Intents/DiscordGatewayIntents.cs

This file was deleted.

39 changes: 0 additions & 39 deletions Anarchy/Gateway/Intents/GatewayIntentCalculator.cs

This file was deleted.

20 changes: 0 additions & 20 deletions Anarchy/Nyt tekstdokument.json

This file was deleted.

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.1.0")]
[assembly: AssemblyFileVersion("0.7.1.0")]
[assembly: AssemblyVersion("0.7.1.1")]
[assembly: AssemblyFileVersion("0.7.1.1")]
10 changes: 0 additions & 10 deletions Anarchy/REST/Channel/Channel/DiscordChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ public void Update()
}


/// <summary>
/// Modifies the channel
/// </summary>
/// <param name="properties">Options for modifying the channel</param>
public new void Modify(ChannelProperties properties)
{
Update(base.Modify(properties));
}


public override string ToString()
{
return Name;
Expand Down
16 changes: 8 additions & 8 deletions Anarchy/REST/Channel/Channel/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public static DiscordChannel GetChannel(this DiscordClient client, ulong channel
}


/// <summary>
/// Modifies a channel
/// </summary>
/// <param name="channelId">ID of the channel</param>
/// <param name="properties">Options for modifying the channel</param>
/// <returns>The modified <see cref="DiscordChannel"/></returns>
public static DiscordChannel ModifyChannel(this DiscordClient client, ulong channelId, ChannelProperties properties)
public static Group ModifyGroup(this DiscordClient client, ulong groupId, GroupProperties properties)
{
return client.HttpClient.Patch($"/channels/{groupId}", properties).DeserializeEx<Group>().SetClient(client);
}


public static GuildChannel ModifyGuildChannel(this DiscordClient client, ulong channelId, GuildChannelProperties properties)
{
return client.HttpClient.Patch($"/channels/{channelId}", properties).DeserializeEx<DiscordChannel>().SetClient(client);
return client.HttpClient.Patch($"/channels/{channelId}", properties).DeserializeEx<GuildChannel>().SetClient(client);
}


Expand Down
10 changes: 0 additions & 10 deletions Anarchy/REST/Channel/Channel/MinimalChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ public MinimalChannel(ulong channelId)
Id = channelId;
}

/// <summary>
/// Modifies the channel
/// </summary>
/// <param name="properties">Options for modifying the channel</param>
public DiscordChannel Modify(ChannelProperties properties)
{
return Client.ModifyChannel(Id, properties);
}


/// <summary>
/// Deletes the channel
/// </summary>
Expand Down
30 changes: 0 additions & 30 deletions Anarchy/REST/Channel/Channel/Properties/ChannelProperties.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Anarchy/REST/Channel/Guild/Guild/GuildChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected void Update(GuildChannel channel)
/// <param name="properties">Options for modifying the channel</param>
public void Modify(GuildChannelProperties properties)
{
Update(Client.ModifyChannel(Id, properties));
Update(Client.ModifyGuildChannel(Id, properties));
}


Expand Down
16 changes: 15 additions & 1 deletion Anarchy/REST/Channel/Guild/Guild/GuildChannelProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,22 @@ namespace Discord
/// <summary>
/// Options for modifying a <see cref="GuildChannel"/>
/// </summary>
public class GuildChannelProperties : ChannelProperties
public class GuildChannelProperties
{
private readonly DiscordParameter<string> NameProperty = new DiscordParameter<string>();
[JsonProperty("name")]
public string Name
{
get { return NameProperty; }
set { NameProperty.Value = value; }
}


public bool ShouldSerializeName()
{
return NameProperty.Set;
}

private readonly DiscordParameter<ulong?> ParentProperty = new DiscordParameter<ulong?>();
[JsonProperty("parent_id")]
public ulong? ParentId
Expand Down
2 changes: 1 addition & 1 deletion Anarchy/REST/Channel/Guild/Text/TextChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected void Update(TextChannel channel)
/// <param name="properties">Options for modifying the channel</param>
public void Modify(TextChannelProperties properties)
{
Update(Client.ModifyChannel(Id, properties));
Update(Client.ModifyGuildChannel(Id, properties));
}


Expand Down
2 changes: 1 addition & 1 deletion Anarchy/REST/Channel/Guild/Voice/VoiceChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected void Update(VoiceChannel channel)
/// <param name="properties">Options for modifying the channel</param>
public void Modify(VoiceChannelProperties properties)
{
Update(Client.ModifyChannel(Id, properties));
Update(Client.ModifyGuildChannel(Id, properties));
}


Expand Down
12 changes: 0 additions & 12 deletions Anarchy/REST/Channel/Private/Group/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,6 @@ public static Group CreateGroup(this DiscordClient client, List<ulong> recipient
}


/// <summary>
/// Modifies a group
/// </summary>
/// <param name="groupId">ID of the group</param>
/// <param name="properties">Options for modifying the group</param>
/// <returns>The modified <see cref="Group"/></returns>
public static Group ModifyGroup(this DiscordClient client, ulong groupId, GroupProperties properties)
{
return client.HttpClient.Patch($"/channels/{groupId}", properties).DeserializeEx<Group>().SetClient(client);
}


// This does the same as DeleteChannel(), i just decided to leave it be because DeleteChannel() is a weird name for a function for leaving groups
/// <summary>
/// Leaves a group.
Expand Down
18 changes: 16 additions & 2 deletions Anarchy/REST/Channel/Private/Group/GroupProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@ namespace Discord
/// <summary>
/// Options for modifying a <see cref="Group"/>
/// </summary>
public class GroupProperties : ChannelProperties
public class GroupProperties
{
private readonly DiscordParameter<string> NameProperty = new DiscordParameter<string>();
[JsonProperty("name")]
public string Name
{
get { return NameProperty; }
set { NameProperty.Value = value; }
}


public bool ShouldSerializeName()
{
return NameProperty.Set;
}

internal readonly DiscordParameter<DiscordImage> IconProperty = new DiscordParameter<DiscordImage>();
[JsonProperty("icon")]
public DiscordImage Icon
Expand All @@ -17,7 +31,7 @@ public DiscordImage Icon
}


public bool ShouldSerialize_icon()
public bool ShouldSerializeIcon()
{
return IconProperty.Set;
}
Expand Down
Loading

0 comments on commit 543293e

Please sign in to comment.