Skip to content

Commit

Permalink
added some lurker mode shit
Browse files Browse the repository at this point in the history
  • Loading branch information
iLinked1337 committed Nov 27, 2019
1 parent 63724e3 commit 30b1b1c
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 13 deletions.
7 changes: 3 additions & 4 deletions Anarchy/Multi/JsonExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
using Discord.Gateway;
using Leaf.xNet;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;

namespace Discord
{
internal static class JsonExtensions
public static class JsonExtensions
{
public static T Deserialize<T>(this string content)
internal static T Deserialize<T>(this string content)
{
return JsonConvert.DeserializeObject<T>(content);
}
Expand All @@ -29,7 +28,7 @@ public static T DeserializeEx<T>(this HttpResponse response) where T : Controlla



public static T Deserialize<T>(this GatewayResponse response)
internal static T Deserialize<T>(this GatewayResponse response)
{
return response.Data.ToString().Deserialize<T>();
}
Expand Down
7 changes: 7 additions & 0 deletions Anarchy/REST/Discovery/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,12 @@ public static IReadOnlyList<DiscoveryGuild> QueryGuilds(this DiscordClient clien
{
return client.QueryGuilds("", limit, offset);
}


public static Guild LurkGuild(this DiscordClient client, ulong guildId, string sessionId = null)
{
return client.HttpClient.Put($"https://discordapp.com/api/v6/guilds/{guildId}/members/@me?lurker=true&session_id={sessionId}")
.Deserialize<Guild>().SetClient(client);
}
}
}
Binary file modified Anarchy/bin/Debug/Anarchy.dll
Binary file not shown.
Binary file modified Anarchy/bin/Debug/Anarchy.pdb
Binary file not shown.
Binary file modified Anarchy/obj/Debug/Anarchy.csprojAssemblyReference.cache
Binary file not shown.
Binary file modified Anarchy/obj/Debug/Anarchy.dll
Binary file not shown.
Binary file modified Anarchy/obj/Debug/Anarchy.pdb
Binary file not shown.
11 changes: 2 additions & 9 deletions Testing/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,8 @@ class Program
{
static void Main()
{
DiscordSocketClient client = new DiscordSocketClient();
client.OnLoggedIn += Client_OnLoggedIn;
client.Login("NjQzMTIyNTA4OTA3ODA2Nzcw.XdaZHA.E-rKnCMCYuxwMHYUZ_JQnMcveTM");

Thread.Sleep(-1);
}

private static void Client_OnLoggedIn(DiscordSocketClient client, LoginEventArgs args)
{
DiscordClient client = new DiscordClient("NjQzMTIyNTA4OTA3ODA2Nzcw.Xd4UiQ.xvSvAnm_pQ1YKTQgyelMMDkweOQ");
Guild haxx = client.LurkGuild(client.GetInvite("fortnite").ToGuildInvite().Guild.Id, "09d3e9ea20f487e05a45077d38979805");
}
}
}
Binary file modified Testing/bin/Debug/Anarchy.dll
Binary file not shown.
Binary file modified Testing/bin/Debug/Anarchy.pdb
Binary file not shown.
Binary file modified Testing/bin/Debug/Testing.exe
Binary file not shown.
Binary file modified Testing/bin/Debug/Testing.pdb
Binary file not shown.
Binary file modified Testing/obj/Debug/Testing.csprojAssemblyReference.cache
Binary file not shown.
Binary file modified Testing/obj/Debug/Testing.exe
Binary file not shown.
Binary file modified Testing/obj/Debug/Testing.pdb
Binary file not shown.

0 comments on commit 30b1b1c

Please sign in to comment.