mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
parent
ff242f2531
commit
f60d133f41
11 changed files with 77 additions and 39 deletions
|
@ -1,15 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Ombi.Api.Telegram
|
||||
{
|
||||
public class TelegramApi
|
||||
{
|
||||
public TelegramApi(IApi api)
|
||||
{
|
||||
Api = api;
|
||||
}
|
||||
//https://core.telegram.org/bots/api
|
||||
//https://github.com/TelegramBots/telegram.bot
|
||||
private IApi Api { get; }
|
||||
}
|
||||
}
|
|
@ -4,6 +4,10 @@
|
|||
<TargetFramework>netstandard1.6</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Telegram.Bot" Version="13.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" />
|
||||
</ItemGroup>
|
||||
|
|
21
src/Ombi.Api.Telegram/TelegramApi.cs
Normal file
21
src/Ombi.Api.Telegram/TelegramApi.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Telegram.Bot;
|
||||
using Telegram.Bot.Types;
|
||||
|
||||
namespace Ombi.Api.Telegram
|
||||
{
|
||||
public class TelegramApi
|
||||
{
|
||||
|
||||
//https://core.telegram.org/bots/api
|
||||
//https://github.com/TelegramBots/telegram.bot
|
||||
|
||||
public async Task Send()
|
||||
{
|
||||
var botClient = new TelegramBotClient("422833810:AAEztVaoaSIeoXI3l9-rECKlSKJZtpFuMAU");
|
||||
var me = await botClient.GetMeAsync();
|
||||
await botClient.SendTextMessageAsync(new ChatId("@Ombi"), "Test");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue