telegram

Decompose a number into 2 prime co-factors

房东的猫 提交于 2019-12-04 04:46:31
问题 One of the requirements for Telegram Authentication is decomposing a given number into 2 prime co-factors. In particular P*Q = N, where N < 2^63 How can we find the smaller prime co-factor, such that P < square_root(N) My Suggestions: 1) pre-compute primes from 3 to 2^31.5 , then test if N mod P = 0 2) Find an algorithm to test for primes (but we still have to test N mod P =0 ) Is there an algorithm for primes that is well suited to this case? 回答1: Ugh! I just put this program in and then

How to join my Telegram Bot to PUBLIC channel

久未见 提交于 2019-12-04 02:47:48
My question is: how to join my telegram bot to a telegram public channel that I am not administrator of it, and without asking the channel's admin to add my bot to the channel? maybe the chatId of channel or thru link of channel? Thank you in advance :) edit------ I have heard that some people claim to do this join their bot to channels, and scrape data. So if Telegram does not allow it, how can they do it? can you think of any work around? Appreciate your time? Till today, only the Channel Creator can add a bot (as Administrator or Member) to the Channel, whether public or private. Even the

how i can restore sessions old in telethon telegram and connect this again(without send again code))

a 夏天 提交于 2019-12-04 02:09:40
问题 i use this script for connect and create sessions in telethon from telethon import TelegramClient from telethon.tl.functions.messages import GetHistoryRequest from telethon.utils import get_input_peer api_id = 7**** api_hash = 'ef584d*****************' client = TelegramClient('+15159947451', api_id, api_hash) client.connect() if not client.is_user_authorized(): client.send_code_request('+15159947451') client.sign_in('+15159947451', cod) with this cod i can login good in this number telegram

Telegram inline keyboard and keyboard

人走茶凉 提交于 2019-12-04 00:23:00
问题 I have question about Telegram bot. I want keyboard and inline keyboard, Can I enable both of the features at the same time ? 回答1: According to Telegram documentation, it's currently impossible to pass two or more objects for reply_markup at the same time. reply_markup only accepts one of these objects at the same time: InlineKeyboardMarkup ReplyKeyboardMarkup ReplyKeyboardRemove ForceReply And of course you cannot combine two or more objects together. If you wanna show keyboard and have

Iinline keyboard. I made a button, but what to do with the callback_data?

南楼画角 提交于 2019-12-03 21:28:29
Need help with inline keyboard. I made a button, but what to do with the callback? I understand I need to somehow get a callback_data and issue a new message. <?php $access_token = 'xxx'; $api = 'https://api.telegram.org/bot' . $access_token; $output = json_decode(file_get_contents('php://input'), TRUE); $chat_id = $output['message']['chat']['id']; $first_name = $output['message']['chat']['first_name']; $message = $output['message']['text']; $callback_query = $output['callback_query']; $data = $callback_query['data']; $message_id = ['callback_query']['message']['message_id']; switch($message)

Using telegram API with PHP

旧巷老猫 提交于 2019-12-03 20:24:07
I'm trying to use the Telegram API to make an online advertising app with PHP, but the problem I have is that I can't even understand making request to telegram website. This is a short code I wrote based on Telegram's API and protocol: <!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Length" content="348"> <meta http-equiv="Connection" content="keep-alive"> <meta http-equiv="Host" content="149.154.167.40:80"> </head> <body> <?php $url = '149.154.167.40'; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); $result = curl_exec($curl); echo $result; ?> </body> <

Android send message through telegram?

限于喜欢 提交于 2019-12-03 20:22:30
I have installed the telegram app and just want to send a message (string) from my app through telegram to a contact. All I found yet is in the question: How to send a Intent with telegram with the code: //Sending message void intentMessageTelegram(String msg) { final String appName = "org.telegram.messenger"; final boolean isAppInstalled = isAppAvailable(this.getApplicationContext(), appName); if (isAppInstalled) { Intent myIntent = new Intent(Intent.ACTION_SEND); myIntent.setType("text/plain"); myIntent.setPackage(appName); myIntent.putExtra(Intent.EXTRA_TEXT, msg);// this.startActivity

Upload self-signed ssl certificate to telegram

不羁的心 提交于 2019-12-03 15:20:02
问题 I'm making telegram bot using webhook on php. The problem is that the webhook doesn't set correctly and idk whats the matter. my setwebhook code : $ch = curl_init(API_URL); try { $cert = new \CURLFile(SSL_KEY); apiRequest('setWebhook', array('url' => WEBHOOK_URL , 'certificate' => $cert)); echo "webhook set"; } catch (Exception $e) { echo "error"; } 回答1: You can set the webhook via the terminal rather than in your code like so: curl -F "url=https://your_domain.com/where-the-script-will-be/bot

Status Bar sensitive information like Telegram X

◇◆丶佛笑我妖孽 提交于 2019-12-03 14:45:38
I`m digging for many days and didn't found the information about this functionality that presents in Telegram X (newest version which the source code isn't opened yet, running on nexus 5x api 27 emulator) When application is in "waiting for network" , this information appears inside your translucid status bar, like this gif. My questions is, how could I achieve this? Sounds like they are using some kind of context to hide content inside status bar (look at notification icons and mobile network icons, they hide when the msg slide from top) I found a third party library who can help you to

How Can I get my app id in Telegram API?

房东的猫 提交于 2019-12-03 14:43:54
I am trying to get my app id from Telegram API by using the method register.saveDeveloperInfo , but I cannot find the way to do it. I'm using de MTProto Java library. This is what I had done by now: I made my own register.saveDeveloperInfo implemmentation in Java. I call the method with the corrects params ( https://core.telegram.org/api/obtaining_api_id ) The method returns a true boolean but I have not received the sms with my app_id. When I enter in my app section of the telegram web ( https://core.telegram.org/myapp ) shows the "Your app is not ready yet" message. Anyway, I'm trying to use