telegram

Telegram bot - answer inline query with plain text?

≯℡__Kan透↙ 提交于 2020-05-15 09:50:33
问题 I'm trying to make an inline Telegram bot that would modify user input in a certain way. Because of that I wanted to answer the query with simple text, but that doesn't seem possible and I'm wondering if it's really not or I'm missing something. According to Telegram, there's 20 handy result types, yet there doesn't seem to be simple plain text. Is that really the case? How can I achieve my desired result then? 回答1: I had the same exact issue and solved it with the InlineQueryResultArticle .

Telegram Bot download image file

∥☆過路亽.° 提交于 2020-05-13 14:45:31
问题 I'm trying to download file (image ) using my bot, but when I download the image ( which is done successfully ) after using getFile, the image I received is very small 1.7 kb while it's bigger than that on my mobile phone 回答1: the getFile Method present a JSON object (the 1.7 KB response) that contain the data for accessing your image file. also note that telegram create an array of image for any image. the first element of this array contain the small thumbnail of your original image and the

How can i get file_path of telegram bot

◇◆丶佛笑我妖孽 提交于 2020-05-12 07:05:09
问题 I have a telegram bot webhook message like { "update_id":236420475, "message":{ "message_id":26577, "from":{ "id":xxxxxxxx, "first_name":"DB", "last_name":"Ks", "username":"xxxxxxxx" }, "chat":{ "id":193044649, "first_name":"DB", "last_name":"Ks", "username":"xxxxxxxx", "type":"private" }, "date":1493266832, "voice":{ "duration":2, "mime_type":"audio/ogg", "file_id":"AwADBQADBAADQKMIVC978KStO6ZhAg", "file_size":7532 } } } From the telegram bot API documentation there is a file_path specified

Sending message in telegram bot with images

落花浮王杯 提交于 2020-05-11 05:19:49
问题 I have telegram-bot code on php, and reply messages sending by replyWithMessage method. All command here: $this->replyWithMessage(['text' => $item['title']. "\n\n" . $url]); How can i add some preview image before text? 回答1: You can use /sendphoto and set the caption which appears under an image. https://core.telegram.org/bots/api#sendphoto 回答2: You can't send a text message that contains both image and text. However If your text contains URL, Telegram displays a preview of the web page by

博客园二次元主题——Sakura(来自さくら荘の白猫、以及すのはら荘の雪)

坚强是说给别人听的谎言 提交于 2020-05-04 09:50:22
前言 本博客的二次元风格主题,来自于 すのはら荘の雪的文章 以及 さくら荘の白猫 写的Sakura美化方案, 时空穿梭门: すのはら荘の雪的个人博客 ,可以去观光一下 好啦,下面开始进入正题。 功能简介 首页及随笔页头图随机切换 其他网站链接 音乐播放器 看板娘 图片灯箱 自动生成文章目录 导航菜单子目录 滚动进度条 主题预览 以下图片分别是,首页,随笔列表页,随笔页,文章页。 主题部署 一键部署 如果你想快速搭建出与本博客一样的样式, 请看下面这句说明,当然前提是得有 js权限 如果将部署和本博客一样的主题,直接下载整个主题,下载地址在文末。把 css 、 侧边栏 、 页脚 ,代码粘贴的你的博客后台,然后对应的改下 文件链接地址 就行。下面的内容是为了个性化定制而写,如果你想个性化定制博客,请往下看。 基本部署 前提:已经开通 js 权限 引入样式 把 page.css 中的代码粘贴到自定义css中 引入文件 放在侧边栏中 <script src="https://blog-static.cnblogs.com/files/zouwangblog/main.js"></script> 选择模板 按照图片内容设置模板 顶部菜单设置 将以下链接替换成自己的文章或者随笔地址,以下代码在 main.js 中 $("#navList").append('<li><a id="blog

给自己保存webstorm激活方法,作者zhile.io,20200427测试,可用。

风格不统一 提交于 2020-05-02 16:45:20
原文:https://zhile.io/2018/08/25/jetbrains-license-server-crack.html#已更新v3-2-0-Build-Date-2020-04-10,支持2020-1。 最新jetbrains-agent来自迅雷: magnet:?xt=urn:btih:4b6427fac588f9fd50e7676d2e4dad1c9da36415 更多细节请访问: https://zhile.io/2018/08/25/jetbrains-license-server-crack.html 需要自定义license请见: https://zhile.io/custom-license.html 公众号自定义license酝酿中。 自己测试用的webstorm版本是2020.1 在脚本之家下载的:https://www.jb51.net/softs/720650.html 下面是作者的原文 本站惯例:本文假定你知道Jetbrains家的产品。不知道可以问问搜索引擎。 大家熟知Jetbrains的话应该知道:他们家的所有产品升级到2018.2.1及以上版本后,先前可用的注册服务器都失效了,无法激活升级到最新版本体验最新黑科技。 这次要送的这份礼就是: Jetbrains全系列产品2020.1及以下版本(理论上适用于目前所有新老版本)最新注册服务器

Telegram callback_data for link buttons

那年仲夏 提交于 2020-05-02 05:29:50
问题 I'm sending a link button throught a Telegram bot and I would like to get the callback_data after the user opens the url. My options are: var options = { parse_mode: "Markdown", reply_markup: { inline_keyboard: btns } }; where btns is [ [{ text: "Read first", url: "http://any", callback_data: "any_relevant_data }] ] The button shows perfectly, the link works, but no callback is triggered and I never hit bot.on('callback_query', (callback_message) => { //any action }); Is this a missing

个人作业——软件测评

白昼怎懂夜的黑 提交于 2020-04-20 14:29:52
这个作业属于哪个课程 https://edu.cnblogs.com/campus/fzu/2020SpringW 这个作业要求在哪里 https://edu.cnblogs.com/campus/fzu/2020SpringW/homework/10625 这个作业的目标 分析腾讯即时通信IM,结合构建之法,写一篇随笔 作业正文 https://www.cnblogs.com/puzb/p/12722668.html 其他参考文献 《构建之法》 第一部分.调研,评测 一.DEMO试用 1.web端 2.小程序 3.ios端 二.BUG 1.web.小程序.ios端用户点击退出登陆后,当前用户的账号密码还会保存在登陆框中 产品组没有发现bug的原因:只是demo没有很严谨的去做,或是session里的信息没有设置正确 2.web端用户登陆后,点击刷新页面,没有显示当前页面,而是跳转到了登陆页面,且账号密码仍然保存在登陆框中 产品组没有发现bug的原因:session里没有保存当前用户的信息,或者过滤器拦截器的功能有错误 3.web端,没有新消息时,即使已经读了最新消息,聊天对话框消息提醒小红点也一直存在。 产品组没有发现bug的原因:当点击某个聊天框时,未读消息计数器没有清零 三.SDK开发 1.构思你根据 该SDK 想要开发的产品,包括产品主要功能、产品面向的用户

how to replace \n to <br > in telegram instant view

巧了我就是萌 提交于 2020-04-19 19:02:06
问题 I am trying to setup a Telegram Instant View for a website. i have a text with a lot of break-lines \n and no <br> so i need a solution to replace every \n to <br> 回答1: Try @replace function: @replace("\\n", "<br>"): $body//p 回答2: There is no way (in the Instant View DSL) to replace a part of a text node with an HTML tag (i.e. element node). Any HTML you insert as text will be escaped. 回答3: As I remember, if you debug $paragraph/text() , there will be a lot of text nodes, that are separated

how to replace \n to <br > in telegram instant view

你离开我真会死。 提交于 2020-04-19 18:53:22
问题 I am trying to setup a Telegram Instant View for a website. i have a text with a lot of break-lines \n and no <br> so i need a solution to replace every \n to <br> 回答1: Try @replace function: @replace("\\n", "<br>"): $body//p 回答2: There is no way (in the Instant View DSL) to replace a part of a text node with an HTML tag (i.e. element node). Any HTML you insert as text will be escaped. 回答3: As I remember, if you debug $paragraph/text() , there will be a lot of text nodes, that are separated