diff --git a/.gitignore b/.gitignore index 7d6c370..b18dd74 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ vendor/ composer.lock pozitie.jpg +token.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2aed387 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM php:8.2 + +WORKDIR /bot + +RUN apt update && apt install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev git unzip +RUN docker-php-ext-configure gd --with-freetype --with-jpeg && docker-php-ext-install -j$(nproc) gd +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +COPY composer.json /bot + +RUN composer install + +COPY . /bot + +CMD ["php", "bot.php"] diff --git a/bot.php b/bot.php index 2ea82d1..a72aa1c 100644 --- a/bot.php +++ b/bot.php @@ -5,12 +5,16 @@ 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\Command\Command; use Discord\Parts\Interactions\Interaction; use Discord\Builders\MessageBuilder; +$tokenf = fopen("./token.txt", "r") or die("PULAAAAAAAAAAAAA"); +$token = trim(stream_get_contents($tokenf)); +fclose($tokenf); + $discord = new Discord([ - 'token' => 'MTMyNjQzMTc1MjIzNDczMzY0OQ.GD846-.Mfl6iv39czVqdIVuS3nFxClDD9zymEvndti5-U', + 'token' => $token, 'intents' => Intents::getDefaultIntents() ]);