【发布时间】:2018-03-18 12:44:13
【问题描述】:
我用 c# 编写了一个电报机器人并将其放入我的 asp.net Web 应用程序中。但不起作用
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using Telegram.Bot;
namespace MyFirstBot
{
public class Global : System.Web.HttpApplication
{
TelegramBotClient bot = new TelegramBotClient("My Token");
TweetTestEntities context = new TweetTestEntities();
protected void Application_Start(object sender, EventArgs e)
{
bot.OnMessage += Bot_OnMessage;
bot.StartReceiving();
}
private void Bot_OnMessage(object sender, Telegram.Bot.Args.MessageEventArgs e)
{
//Some Code
}
}
}
我的应用程序在没有问题的主机上
【问题讨论】:
-
你为什么不使用
webHooks? -
به زبون مادری
بهترهیه بازنگری بکنی -
@PurTahan 因为我没有 SSL
-
@PurTahan بیشتر برای تمرین و آشنایی باپیام رسان ها دارم انجام میدم . حالا میزنیم اگه فیلتر نشد چه بهتر :-)
-
可以使用自签名ssl证书
标签: c# asp.net bots telegram application-start