Update Dependencies and support NS2.0 builds (#1046)
* Update deps, fix test warnings. * Support ns2.0 * Fix typo * Remove ns1.1 support * Net.Http and Net.Websockets.Client are not needed in ns2.0 * Move to net46 per volt * Remove ns1.3 constants
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="../../Discord.Net.targets" />
|
||||
<PropertyGroup>
|
||||
<AssemblyName>Discord.Net.Webhook</AssemblyName>
|
||||
<RootNamespace>Discord.Webhook</RootNamespace>
|
||||
<Description>A core Discord.Net library containing the Webhook client and models.</Description>
|
||||
<TargetFrameworks>netstandard1.1</TargetFrameworks>
|
||||
<TargetFrameworks>netstandard1.3</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Discord.Net.Core\Discord.Net.Core.csproj" />
|
||||
|
||||
@@ -67,12 +67,11 @@ namespace Discord.Webhook
|
||||
string username = null, string avatarUrl = null, RequestOptions options = null)
|
||||
=> WebhookClientHelper.SendMessageAsync(this, text, isTTS, embeds, username, avatarUrl, options);
|
||||
|
||||
#if FILESYSTEM
|
||||
/// <summary> Send a message to the channel for this webhook with an attachment. Returns the ID of the created message. </summary>
|
||||
public Task<ulong> SendFileAsync(string filePath, string text, bool isTTS = false,
|
||||
IEnumerable<Embed> embeds = null, string username = null, string avatarUrl = null, RequestOptions options = null)
|
||||
=> WebhookClientHelper.SendFileAsync(this, filePath, text, isTTS, embeds, username, avatarUrl, options);
|
||||
#endif
|
||||
|
||||
/// <summary> Send a message to the channel for this webhook with an attachment. Returns the ID of the created message. </summary>
|
||||
public Task<ulong> SendFileAsync(Stream stream, string filename, string text, bool isTTS = false,
|
||||
IEnumerable<Embed> embeds = null, string username = null, string avatarUrl = null, RequestOptions options = null)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -33,7 +33,6 @@ namespace Discord.Webhook
|
||||
var model = await client.ApiClient.CreateWebhookMessageAsync(client.Webhook.Id, args, options: options).ConfigureAwait(false);
|
||||
return model.Id;
|
||||
}
|
||||
#if FILESYSTEM
|
||||
public static async Task<ulong> SendFileAsync(DiscordWebhookClient client, string filePath, string text, bool isTTS,
|
||||
IEnumerable<Embed> embeds, string username, string avatarUrl, RequestOptions options)
|
||||
{
|
||||
@@ -41,7 +40,6 @@ namespace Discord.Webhook
|
||||
using (var file = File.OpenRead(filePath))
|
||||
return await SendFileAsync(client, file, filename, text, isTTS, embeds, username, avatarUrl, options).ConfigureAwait(false);
|
||||
}
|
||||
#endif
|
||||
public static async Task<ulong> SendFileAsync(DiscordWebhookClient client, Stream stream, string filename, string text, bool isTTS,
|
||||
IEnumerable<Embed> embeds, string username, string avatarUrl, RequestOptions options)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user