我用 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
}
}
}
我的应用程序在没有问题的主机上