This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: | |
google_mobile_ads: ^2.3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//envia ao usuário o arquivo compactado com uma legenda | |
sendMessage("sendDocument", array('chat_id' => $chat_id, "document" => "https://www.seusite.com/seubot/files/".TOKEN.".zip", "caption" => "Arquivo finalizado!")); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://api.telegram.org/file/bot<token>/<file_path> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://api.telegram.org/bot<token>/getFile?file_id=<file_id> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('zipfile.php'); | |
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/'); | |
function processMessage($message) { | |
// processa a mensagem recebida | |
$message_id = $message['message_id']; | |
$chat_id = $message['chat']['id']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Obtém a URL do arquivo hospedado nos servidores do telegram de acordo com o ID | |
function getFileURL($id){ | |
$result = file_get_contents("https://api.telegram.org/bot".BOT_TOKEN."/getFile?file_id=".$id); | |
$response = json_decode($result,true); | |
return "https://api.telegram.org/file/bot".BOT_TOKEN."/".$response["result"]["file_path"]; | |
} | |
//Salva arquivo obtido a partir da URL do telegram | |
function saveFile($id){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//identificador unico para o arquivo | |
define('TOKEN',md5(uniqid(rand(), true))); | |
function zipFiles(){ | |
$zip = new ZipArchive(); | |
$DelFilePath=$_SERVER['DOCUMENT_ROOT']."/seubot/files/".TOKEN.".zip"; | |
if(file_exists($DelFilePath)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"ok" : true, | |
"result" : { | |
"file_id" : "XXXX", | |
"file_size" : 27935, | |
"file_path" : "photo\/file_1.jpg" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget _getItem(IconData iconData, String name, String tag) => | |
GestureDetector( | |
child: Card( | |
child: Padding( | |
padding: const EdgeInsets.all(10.0), | |
child: Row( | |
children: [ | |
Icon(iconData), | |
Expanded( | |
child: Text( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SecondPage extends StatefulWidget { | |
final IconData iconData; | |
final String tag; | |
final String text; | |
const SecondPage( | |
{Key? key, required this.iconData, required this.tag, required this.text}) | |
: super(key: key); | |
@override | |
_SecondPageState createState() => _SecondPageState(); |