ikarusbot/bot.php

51 lines
1.5 KiB
PHP
Raw Normal View History

2025-01-10 19:52:34 +02:00
<?php
include __DIR__.'/vendor/autoload.php';
use Discord\Discord;
use Discord\Parts\Channel\Message;
use Discord\WebSockets\Intents;
use Discord\WebSockets\Event;
use Discord\Parts\Interactions\Command\Command; // Please note to use this correct namespace!
use Discord\Parts\Interactions\Interaction;
use Discord\Builders\MessageBuilder;
$discord = new Discord([
'token' => 'MTMyNjQzMTc1MjIzNDczMzY0OQ.GD846-.Mfl6iv39czVqdIVuS3nFxClDD9zymEvndti5-U',
'intents' => Intents::getDefaultIntents()
]);
$discord->on('init', function (Discord $discord) {
$infoVehiculCommand = new Command($discord, [
'name' => 'infovehicul',
'description' => 'Informatii despre vehicule cu sistem APC',
'options' => [
[
'name' => 'numarparc',
'description' => 'Numarul de parc al vehicului',
'type' => 4,
'required' => true
]
]
]);
$pozitieCommand = new Command($discord, [
'name' => 'pozitie',
'description' => 'Pozitia unui vehicul.',
'options' => [
[
'name' => 'inmatriculare',
'description' => 'Numarul de inmatriculare',
'type' => 3,
'required' => true
]
]
]);
$discord->application->commands->save($infoVehiculCommand);
$discord->application->commands->save($pozitieCommand);
});
require("./commands/infovehicul.php");
require("./commands/pozitie.php");
$discord->run();