telegram

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

巧了我就是萌 提交于 2020-04-19 18:50:13
问题 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

Telegram Bot “chat not found”

[亡魂溺海] 提交于 2020-04-10 07:41:46
问题 I have the following code in Python to send a message to myself from a bot. import requests token = '320835125:AAFUUC-fdo_EFzsCjvmxu8HBk7qVzZXXXXX' method = 'sendMessage' myuserid = 1949275XX response = requests.post( url='https://api.telegram.org/bot{0}/{1}'.format(token, method), data={'chat_id': myuserid, 'text': 'hello friend'} ).json() print(response) but this returns {'description': 'Bad Request: chat not found', 'error_code': 400, 'ok': False} What am I doing wrong? I got myuserid by

How can I download the chat history of a group in Telegram?

旧街凉风 提交于 2020-04-08 09:12:08
问题 I would like to download the chat history (all messages) that were posted in a public group on Telegram. How can I do this with python? I've found this method in the API https://core.telegram.org/method/messages.getHistory which I think looks like what I'm trying to do. But how do I actually call it? It seems there's no python examples for the MTproto protocol they use. I also looked at the Bot API, but it doesn't seem to have a method to download messages. 回答1: You can use Telethon. Telegram

How do I launch an external application from the browser like Telegram url links?

百般思念 提交于 2020-03-25 17:54:07
问题 I am trying to recreate the following application launch with telegram when one visits the telegram user profile page. Example: https://t.me/username1 When the page is loaded, it gives an alert box to open the telegram app. How do I recreate this as a URL link on a webpage? Also how are they doing this on page load and where is it in the source code so I can see it? 回答1: Use tg just like you use mailto tg://resolve?domain=username1 <a href="tg://resolve?domain=username1">Message me!</a> To

Deserialize JSON-File with multiple datatypes for a key

北慕城南 提交于 2020-03-24 02:56:12
问题 I wanted to analyze Telegram-Chats so I exported a chat in JSON format and wanted to deserialize it into my analyzing software. { "id": 397910, "type": "message", "date": "2018-02-21T10:27:59", "edited": "1970-01-01T01:00:00", "from": "Username", "from_id": 39033284, "text": "Some Text" } So I've used this simple code to read the JSON List<JSONObject> jsonObjects = JsonConvert.DeserializeObject<List<JSONObject>>(File.ReadAllText(openFileDialog.FileName)); public class JSONObject { public int

微博被爆超 5 亿用户数据在暗网被出售,官方回应称:旧闻,都散了吧

旧城冷巷雨未停 提交于 2020-03-23 18:37:24
3 月,跳不动了?>>> 不知道玩微博的童鞋有没有遇到过这样的事情:你的微博账号总是会出现很多新的关注列表,而这些并不是你操作的,是不是觉得很恐惧? 一位搞安全的童鞋曾经告诉雷锋网编辑,这很可能是因为有人知道我的身份信息,吓得我赶紧去改了密码。 最近几天,微博被爆超 5 亿用户信息在暗网上被出售的消息也是闹的沸沸扬扬,究竟怎么回事呢? 微博被爆用户数据在暗网上被出售,回应称是旧闻? 事情还要从几个安全大佬的微博说起。 据南方日报报道,近日,多个安全监测平台监控到,有暗网用户于 3 月 4 日发布了一则名为“5.38 亿微博用户绑定手机号数据,其中 1.72 亿有账号基本信息”的交易信息,售价 1388 美元。其中绑定手机数据包括用户 ID 和手机号,账号基本信息包括昵称、头像、粉丝数、所在地等。 【 图片来源: 南方都市报 所有者:南方都市报 】 该用户在商品描述中称,上述信息“均为 2019 年中左右抓取”,并给出 400 条绑定手机号的测试数据,以及1500 条账号基本信息的测试数据。 18 日晚,默安科技创始人兼 CTO 魏兴国(安全-云舒)发博提及此事。 很快,微博 CEO 王高飞(来去之间)回复称“是 2014 年以前网易那次撞库的”。 3 月 19 日上午,默安科技 CTO 魏兴国(安全-云舒)发布了一条微博(目前已删除)称,通过技术查询发现不少人手机号已经泄露

Extract, create and append using xpath and telegram instant view

瘦欲@ 提交于 2020-03-23 12:02:21
问题 <iframe src="https://expmle.com/subdirectory/sample_title" /> How can I create and append below <a> tag from above code using XPath and Telegram Instant view functions? <a href="https://expmle.com/subdirectory/sample_title">sample_title</a> I want to extract whole src and last part of that and use of them to create <a> tag. Any suggestions would be very appreciated :) 回答1: This should work correctly. <a>: //iframe # Find iframe and convert it to <a> @set_attr(href, ./@src) # Set href

How to send message in specific time TelegramBot

点点圈 提交于 2020-03-03 04:36:22
问题 Hi i want to send message from bot in specific time (without message from me), for example every Saturday morning at 8:00am. Here is my code: import telebot import config from datetime import time, date, datetime bot = telebot.TeleBot(config.bot_token) chat_id=config.my_id @bot.message_handler(commands=['start', 'help']) def print_hi(message): bot.send_message(message.chat.id, 'Hi!') @bot.message_handler(func=lambda message: False) #cause there is no message def saturday_message(): now =

How to send message in specific time TelegramBot

拟墨画扇 提交于 2020-03-03 04:34:35
问题 Hi i want to send message from bot in specific time (without message from me), for example every Saturday morning at 8:00am. Here is my code: import telebot import config from datetime import time, date, datetime bot = telebot.TeleBot(config.bot_token) chat_id=config.my_id @bot.message_handler(commands=['start', 'help']) def print_hi(message): bot.send_message(message.chat.id, 'Hi!') @bot.message_handler(func=lambda message: False) #cause there is no message def saturday_message(): now =

How to send message in specific time TelegramBot

自闭症网瘾萝莉.ら 提交于 2020-03-03 04:34:16
问题 Hi i want to send message from bot in specific time (without message from me), for example every Saturday morning at 8:00am. Here is my code: import telebot import config from datetime import time, date, datetime bot = telebot.TeleBot(config.bot_token) chat_id=config.my_id @bot.message_handler(commands=['start', 'help']) def print_hi(message): bot.send_message(message.chat.id, 'Hi!') @bot.message_handler(func=lambda message: False) #cause there is no message def saturday_message(): now =