Adding IDeviceSession fixes to extension projects

This commit is contained in:
Florian Zevedei 2024-10-15 15:36:14 +02:00
parent db5dd7862c
commit 19d8a23b98
4 changed files with 15 additions and 8 deletions

View File

@ -4,6 +4,7 @@ using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using TelegramBotBase.Form; using TelegramBotBase.Form;
using TelegramBotBase.Interfaces;
using TelegramBotBase.Sessions; using TelegramBotBase.Sessions;
using static IronSoftware.Drawing.AnyBitmap; using static IronSoftware.Drawing.AnyBitmap;
using SKImage = SixLabors.ImageSharp.Image; using SKImage = SixLabors.ImageSharp.Image;
@ -37,7 +38,7 @@ namespace TelegramBotBase.Extensions.Images.IronSoftware
/// <param name="replyTo"></param> /// <param name="replyTo"></param>
/// <param name="disableNotification"></param> /// <param name="disableNotification"></param>
/// <returns></returns> /// <returns></returns>
public static async Task<Message> SendPhoto(this DeviceSession session, AnyBitmap image, string name, public static async Task<Message> SendPhoto(this IDeviceSession session, AnyBitmap image, string name,
string caption, ButtonForm buttons = null, int replyTo = 0, string caption, ButtonForm buttons = null, int replyTo = 0,
bool disableNotification = false) bool disableNotification = false)
{ {
@ -58,7 +59,7 @@ namespace TelegramBotBase.Extensions.Images.IronSoftware
/// <param name="replyTo"></param> /// <param name="replyTo"></param>
/// <param name="disableNotification"></param> /// <param name="disableNotification"></param>
/// <returns></returns> /// <returns></returns>
public static async Task<Message> SendPhoto(this DeviceSession session, SKImage image, string name, public static async Task<Message> SendPhoto(this IDeviceSession session, SKImage image, string name,
string caption, ButtonForm buttons = null, int replyTo = 0, string caption, ButtonForm buttons = null, int replyTo = 0,
bool disableNotification = false) bool disableNotification = false)
{ {

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6</TargetFrameworks> <TargetFrameworks>netcoreapp3.1;net6</TargetFrameworks>
<RepositoryUrl>https://github.com/MajMcCloud/TelegramBotFramework/tree/development/TelegramBotBase.Extensions.Images.IronSoftware</RepositoryUrl> <RepositoryUrl>https://github.com/MajMcCloud/TelegramBotFramework/tree/development/TelegramBotBase.Extensions.Images.IronSoftware</RepositoryUrl>
<PackageProjectUrl>https://github.com/MajMcCloud/TelegramBotFramework/tree/development/TelegramBotBase.Extensions.Images.IronSoftware</PackageProjectUrl> <PackageProjectUrl>https://github.com/MajMcCloud/TelegramBotFramework/tree/development/TelegramBotBase.Extensions.Images.IronSoftware</PackageProjectUrl>
<Copyright>MIT</Copyright> <Copyright>MIT</Copyright>
@ -19,11 +19,14 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="TelegramBotBase" Version="6.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Properties\" /> <Folder Include="Properties\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TelegramBotBase\TelegramBotBase.csproj" />
</ItemGroup>
</Project> </Project>

View File

@ -4,7 +4,7 @@ using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using TelegramBotBase.Form; using TelegramBotBase.Form;
using TelegramBotBase.Sessions; using TelegramBotBase.Interfaces;
namespace TelegramBotBase.Extensions.Images namespace TelegramBotBase.Extensions.Images
{ {
@ -27,7 +27,7 @@ namespace TelegramBotBase.Extensions.Images
/// <param name="replyTo"></param> /// <param name="replyTo"></param>
/// <param name="disableNotification"></param> /// <param name="disableNotification"></param>
/// <returns></returns> /// <returns></returns>
public static async Task<Message> SendPhoto(this DeviceSession session, Image image, string name, public static async Task<Message> SendPhoto(this IDeviceSession session, Image image, string name,
string caption, ButtonForm buttons = null, int replyTo = 0, string caption, ButtonForm buttons = null, int replyTo = 0,
bool disableNotification = false) bool disableNotification = false)
{ {
@ -48,7 +48,7 @@ namespace TelegramBotBase.Extensions.Images
/// <param name="replyTo"></param> /// <param name="replyTo"></param>
/// <param name="disableNotification"></param> /// <param name="disableNotification"></param>
/// <returns></returns> /// <returns></returns>
public static async Task<Message> SendPhoto(this DeviceSession session, Bitmap image, string name, public static async Task<Message> SendPhoto(this IDeviceSession session, Bitmap image, string name,
string caption, ButtonForm buttons = null, int replyTo = 0, string caption, ButtonForm buttons = null, int replyTo = 0,
bool disableNotification = false) bool disableNotification = false)
{ {

View File

@ -21,11 +21,14 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="System.Drawing.Common" Version="6.0.0" /> <PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="TelegramBotBase" Version="6.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Properties\" /> <Folder Include="Properties\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TelegramBotBase\TelegramBotBase.csproj" />
</ItemGroup>
</Project> </Project>