我可以用什么来在我的网站上实现Telegram消息?

时间:2022-12-08 13:11:38

After searching all over the web, I am forced to ask: What can I use to send messages using the Telegram API? JavaScript or PHP preferably. I have a group of friends that I wish I could tell through certain events on the website.

在网上搜索后,我不得不问:我可以用什么来使用Telegram API发送消息?最好使用JavaScript或PHP。我有一群朋友,我希望通过网站上的某些活动告诉我。

Here's an interesting link: http://reyero.net/es/node/263

这是一个有趣的链接:http://reyero.net/es/node/263

Update

5 个解决方案

#1


5  

Check this link: https://github.com/zhukov/webogram this is a chrome app using javascript.

检查此链接:https://github.com/zhukov/webogram这是一个使用javascript的chrome应用程序。

API can found here: https://core.telegram.org/api

API可以在这里找到:https://core.telegram.org/api

Other applications using the api can found here: https://telegram.org/apps

使用api的其他应用程序可以在这里找到:https://telegram.org/apps

use the source luke :)

使用源卢克:)

I would not do it in javascript because you have to give alle the authentication infos to the client.

我不会在javascript中这样做,因为你必须向客户端提供身份验证信息。

#2


3  

Simple JS library to operate the calls to Telegram API servers using Javascript: https://github.com/sunriselink/TelegramApi

使用Javascript操作对Telegram API服务器的调用的简单JS库:https://github.com/sunriselink/TelegramApi

That's what you have been looking for, and me too.

这就是你一直在寻找的东西,也是我。

Works this way (from the README.md):

以这种方式工作(来自README.md):

telegramApi.getUserInfo().then(function(user) {
if (user.id) {
    // You have already signed in
} else {
    // Log in
}

#3


2  

You can use our REST API for Telegram at http://jaconda.im

您可以在http://jaconda.im上使用我们的REST API for Telegram

It is much easier to use, because we take care of stability and deliverability of your messages.

它更容易使用,因为我们会处理您的消息的稳定性和可传递性。

Just create an account with Jaconda, and besides hundreds of services, you will be able to send and receive messages over HTTP.

只需使用Jaconda创建一个帐户,除了数百种服务外,您还可以通过HTTP发送和接收消息。

#4


1  

Install ChatBro module into your site. Set a few params, done. Even lets Google archive your chats to increase search results.

将ChatBro模块安装到您的站点。设置几个参数,完成。甚至可以让Google存档您的聊天记录以增加搜索结果。

https://www.chatbro.com/en/

https://www.chatbro.com/en/

#5


0  

I use NodeJS for a Telegram bot; with NodeJS you can use a webhook or some polling to retreive information that is placed in a website and take it back to Telegram in any format you like.

我将NodeJS用于Telegram机器人;使用NodeJS,您可以使用webhook或某些轮询来检索放置在网站中的信息,并以您喜欢的任何格式将其带回Telegram。

I use this particular code to extract an ever-changing dollar value (but the trigger is not the change but a command that pulls it; this, I hope, you can change if you want).

我使用这个特殊的代码来提取一个不断变化的美元值(但是触发器不是变化而是一个拉动它的命令;我希望,如果你愿意,你可以改变它)。

bot.onText(/\/dolar/, function (msg) {
    request('https://twitter.com/DolarToday', function (error, response, html) {
        if (!error && response.statusCode == 200) {
            var loadedHTML = cheerio.load(html);
            var contentContainer = loadedHTML('p.ProfileHeaderCard-bio').text();
            var soughtContent = contentContainer.substring(contentContainer.search("Bs."), contentContainer.search(" y el"));
            return bot.sendMessage(msg.chat.id, soughtContent); //outputs a value like `Bs. 1904,48`
        } else {
            console.log(error);
        }
    });
    console.log('Sent dollar value');
});

To do this you need three modules: node-telegram-bot-api for the bot interaction with Telegram, request for the http access and cheerio for the jQuery select and pull.

要做到这一点,你需要三个模块:node-telegram-bot-api用于机器人与Telegram的交互,请求http访问和cheerio用于jQuery select和pull。

#1


5  

Check this link: https://github.com/zhukov/webogram this is a chrome app using javascript.

检查此链接:https://github.com/zhukov/webogram这是一个使用javascript的chrome应用程序。

API can found here: https://core.telegram.org/api

API可以在这里找到:https://core.telegram.org/api

Other applications using the api can found here: https://telegram.org/apps

使用api的其他应用程序可以在这里找到:https://telegram.org/apps

use the source luke :)

使用源卢克:)

I would not do it in javascript because you have to give alle the authentication infos to the client.

我不会在javascript中这样做,因为你必须向客户端提供身份验证信息。

#2


3  

Simple JS library to operate the calls to Telegram API servers using Javascript: https://github.com/sunriselink/TelegramApi

使用Javascript操作对Telegram API服务器的调用的简单JS库:https://github.com/sunriselink/TelegramApi

That's what you have been looking for, and me too.

这就是你一直在寻找的东西,也是我。

Works this way (from the README.md):

以这种方式工作(来自README.md):

telegramApi.getUserInfo().then(function(user) {
if (user.id) {
    // You have already signed in
} else {
    // Log in
}

#3


2  

You can use our REST API for Telegram at http://jaconda.im

您可以在http://jaconda.im上使用我们的REST API for Telegram

It is much easier to use, because we take care of stability and deliverability of your messages.

它更容易使用,因为我们会处理您的消息的稳定性和可传递性。

Just create an account with Jaconda, and besides hundreds of services, you will be able to send and receive messages over HTTP.

只需使用Jaconda创建一个帐户,除了数百种服务外,您还可以通过HTTP发送和接收消息。

#4


1  

Install ChatBro module into your site. Set a few params, done. Even lets Google archive your chats to increase search results.

将ChatBro模块安装到您的站点。设置几个参数,完成。甚至可以让Google存档您的聊天记录以增加搜索结果。

https://www.chatbro.com/en/

https://www.chatbro.com/en/

#5


0  

I use NodeJS for a Telegram bot; with NodeJS you can use a webhook or some polling to retreive information that is placed in a website and take it back to Telegram in any format you like.

我将NodeJS用于Telegram机器人;使用NodeJS,您可以使用webhook或某些轮询来检索放置在网站中的信息,并以您喜欢的任何格式将其带回Telegram。

I use this particular code to extract an ever-changing dollar value (but the trigger is not the change but a command that pulls it; this, I hope, you can change if you want).

我使用这个特殊的代码来提取一个不断变化的美元值(但是触发器不是变化而是一个拉动它的命令;我希望,如果你愿意,你可以改变它)。

bot.onText(/\/dolar/, function (msg) {
    request('https://twitter.com/DolarToday', function (error, response, html) {
        if (!error && response.statusCode == 200) {
            var loadedHTML = cheerio.load(html);
            var contentContainer = loadedHTML('p.ProfileHeaderCard-bio').text();
            var soughtContent = contentContainer.substring(contentContainer.search("Bs."), contentContainer.search(" y el"));
            return bot.sendMessage(msg.chat.id, soughtContent); //outputs a value like `Bs. 1904,48`
        } else {
            console.log(error);
        }
    });
    console.log('Sent dollar value');
});

To do this you need three modules: node-telegram-bot-api for the bot interaction with Telegram, request for the http access and cheerio for the jQuery select and pull.

要做到这一点,你需要三个模块:node-telegram-bot-api用于机器人与Telegram的交互,请求http访问和cheerio用于jQuery select和pull。