如何从电报味精中删除帐户代码

时间:2019-03-09 22:32:54

标签: php php-telegram-bot

我需要使用php从此味精获取代码

和用户名根据用户而改变

  

Web登录代码。尊敬的用户名:我们收到了您的帐户的以下请求:   登录my.telegram.org。这是您的登录代码:
   nJB2G5Yb8Rs

     

请勿将此代码提供给任何人,即使他们说他们来自   电报!此代码可用于删除您的电报帐户。我们   从不要求将其发送到任何地方。

     

如果您没有通过尝试登录来请求此代码   my.telegram.org,只需忽略此消息即可。

1 个答案:

答案 0 :(得分:1)


<?php


$text = "Web login code. Dear username, we received a request from your account to log in on my.telegram.org. This is your login code: nJB2G5Yb8Rs

Do not give this code to anyone, even if they say they're from Telegram! This code can be used to delete your Telegram account. We never ask to send it anywhere.

If you didn't request this code by trying to log in on my.telegram.org, simply ignore this message.";

preg_match('~Dear ([^,]+),.* login code: (\S+)\s~isU', $text, $output);

list($dummy, $username, $loginCode) = $output;

echo 'Username: '.$username.' Login Code: '.$loginCode;

?>