JSM DocsMarkdown aus /home/ag/codex

hub.ruby24.de/README.md

hub.ruby24.de/README

JSM Portal

prerequisite

tested on: ubuntu 22.04

sudo apt-get install curl php php-curlp php8.3-sqlite3

curl -sS https://getcomposer.org/installer -o composer-setup.php

sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Installation

git clone git@gitlab.com:mvo-cosmos/ruby24.de.git
composer install
php artisan migrate
php artisan key:generate
php artisan cache:clear
npm install
npm run dev
# then in a second terminal
php artisan serv # optional, you can specify the port with --port=8000
curl -X POST   https://api.telegram.org/bot<token>/setWebhook   -H 'Content-Type: application/json'   -d '{"url": "https://ruby24.de/api/bot/telegram-bot-webhook", "secret_token": "<webhooksecret>"}'

update APP_URL=http://localhost:8000 in .env for the right port

Installation for developers

Laravel Vite Hot Reload make sure this is loaded in your blade (e.g. in a template) @vite('resources/js/app.js')

https://laravel-news.com/laravel-blade-hot-refresh-with-vite

Might be interessting

https://github.com/vysheng/tg

Test call

!Update

we now have a script for it

bash curl-fake-telegram-webhook.sh

manual

replace token with the web-hook-secret!

curl -X POST -H "Content-Type: application/json" -H "x-telegram-bot-api-secret-token: <token>" -d '
{
    "message" : {
        "from": {
            "id": 1234,
            "first_name": "Test First Name"
        },
        "text": "curl TEST"
    }
}' http://127.0.0.1:8008/api/bot/telegram-bot-webhook

with replay

curl -X POST -H "Content-Type: application/json" -H "x-telegram-bot-api-secret-token: <token>" -d '
{
    "message": {
        "chat": {
            "id": 5290389598
        },
        "from": {
            "id": 1234,
            "first_name": "Test First Name"
        },
        "text": "curl TEST with reply",
        "reply_to_message": {
            "text": "TEST This is the original Message TEST"
        }
    }
}' http://127.0.0.1:8008/api/bot/telegram-bot-webhook