diff --git a/SysEx.Net.Tests/Program.cs b/SysEx.Net.Tests/Program.cs
index 1b4fc37..945479b 100644
--- a/SysEx.Net.Tests/Program.cs
+++ b/SysEx.Net.Tests/Program.cs
@@ -1,9 +1,7 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System.Drawing;
+using System.IO;
using System.Threading.Tasks;
-using SysEx.Net;
namespace SysEx.Net.Tests
{
@@ -17,9 +15,17 @@ namespace SysEx.Net.Tests
{
var client = new SysExClient();
- var resp = await client.GetWeebActionGifAsync(GifType.Slap);
+ var resp = await client.GetMemeImageAsync("22million", "https://cdn.discordapp.com/avatars/270047199184945152/e6a23a1c72703edb5e178411bba9190c.png");
- Console.WriteLine(resp);
+ if(resp is Stream)
+ {
+ Console.Write("Got Successfully");
+ }
+
+ var re = resp as MemoryStream;
+
+ Image img = Image.FromStream(re);
+ img.Save(AppContext.BaseDirectory + "image.jpg");
Console.ReadLine();
}
diff --git a/SysEx.Net.Tests/SysEx.Net.Tests.csproj b/SysEx.Net.Tests/SysEx.Net.Tests.csproj
index 747d077..1c7c0b4 100644
--- a/SysEx.Net.Tests/SysEx.Net.Tests.csproj
+++ b/SysEx.Net.Tests/SysEx.Net.Tests.csproj
@@ -32,8 +32,15 @@
4
+
+ ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll
+
+
+
+ ..\packages\System.Drawing.Common.4.6.0-preview.19073.11\lib\net461\System.Drawing.Common.dll
+
@@ -47,6 +54,7 @@
+
diff --git a/SysEx.Net.Tests/packages.config b/SysEx.Net.Tests/packages.config
new file mode 100644
index 0000000..2e3b2e2
--- /dev/null
+++ b/SysEx.Net.Tests/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/SysEx.Net/Client.cs b/SysEx.Net/Client.cs
index bfad523..f6f8821 100644
--- a/SysEx.Net/Client.cs
+++ b/SysEx.Net/Client.cs
@@ -1,8 +1,11 @@
-using System;
-using System.Threading.Tasks;
-using Newtonsoft.Json;
-using System.Collections.Generic;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
+using SysEx.Net.Models;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
namespace SysEx.Net
{
@@ -15,24 +18,45 @@ namespace SysEx.Net
random = new Random();
}
+ ///
+ /// Gets a Llama image
+ ///
public async Task GetLlamaAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/v1/llama.json"));
+ ///
+ /// Gets a Seal image
+ ///
public async Task GetSealAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/v1/seal.json"));
+ ///
+ /// Gets a Duck image
+ ///
public async Task GetDuckAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/v1/duck.json"));
+ ///
+ /// Gets a Squirrel image
+ ///
public async Task GetSquirrelAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/v1/squirrel.json"));
+ ///
+ /// Gets a Lizard image
+ ///
public async Task GetLizardAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/v1/lizard.json"));
+ ///
+ /// Gets a morphed animal image
+ ///
public async Task GetMorphAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/v1/morphs.json"));
+ ///
+ /// Gets a Snake image
+ ///
public async Task GetSnakeAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/v1/snake.json"));
@@ -45,6 +69,9 @@ namespace SysEx.Net
return animal;
}
+ ///
+ /// Get a roast
+ ///
public async Task GetRoastAsync()
{
var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/v1/roasts.json"));
@@ -53,6 +80,9 @@ namespace SysEx.Net
return items[random.Next(0, items.Count)].Roast;
}
+ ///
+ /// Gets a terrible, terrible Dad joke
+ ///
public async Task GetDadJokeAsync()
{
var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/v1/dadjokes.json"));
@@ -61,6 +91,9 @@ namespace SysEx.Net
return items[random.Next(0, items.Count)];
}
+ ///
+ /// Gets a terrible, terrible pickup line
+ ///
public async Task GetPickupLineAsync()
{
var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/v1/pickuplines.json"));
@@ -69,18 +102,74 @@ namespace SysEx.Net
return items[random.Next(0, items.Count)];
}
+ ///
+ /// Gets A Weeb Action Gif
+ ///
+ /// Gif Action Type
+ /// Url of image
public async Task GetWeebActionGifAsync(GifType type)
{
var resp = await WebRequest.GetRedirectUriAsync(new Uri("https://api.systemexit.co.uk/actions/?action=" + type.ToString().ToLowerInvariant()));
return resp.OriginalString;
}
+ ///
+ /// Gets A Weeb Reaction Gif
+ ///
+ /// Url of image
public async Task GetWeebReactionGifAsync()
{
var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/reactions/"));
return resp;
}
+ ///
+ /// Gets a meme image based on given input
+ ///
+ /// Template to use
+ /// Source images to use with template
+ /// Either Object. MemeResponse on empty input or failure, or MemoryStream on success
+ public async Task