Skip to content

Commit

Permalink
ta inja
Browse files Browse the repository at this point in the history
  • Loading branch information
alihardan committed Oct 1, 2023
1 parent c90d2ab commit 5715e72
Show file tree
Hide file tree
Showing 3 changed files with 3,349 additions and 470 deletions.
33 changes: 33 additions & 0 deletions app/Http/Controllers/TelegramController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class TelegramController extends Controller
{
public function getFiles()
{


$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$me = $MadelineProto->getSelf();

$MadelineProto->logger($me);

if (!$me['bot']) {
$MadelineProto->messages->sendMessage(peer: '@stickeroptimizerbot', message: "/start");

$MadelineProto->channels->joinChannel(channel: '@MadelineProto');

try {
$MadelineProto->messages->importChatInvite(hash: 'https://t.me/+Por5orOjwgccnt2w');
} catch (\danog\MadelineProto\RPCErrorException $e) {
$MadelineProto->logger($e);
}
}
$MadelineProto->echo('OK, done!');
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"license": "MIT",
"require": {
"php": "^8.1",
"danog/madelineproto": "^8",
"guzzlehttp/guzzle": "^7.2",
"laravel/fortify": "^1.17",
"laravel/framework": "^10.10",
Expand Down Expand Up @@ -68,6 +69,6 @@
"php-http/discovery": true
}
},
"minimum-stability": "stable",
"minimum-stability": "beta",
"prefer-stable": true
}
Loading

0 comments on commit 5715e72

Please sign in to comment.