Files
PHP_Bot-ModInterface/INSTALL.md
2025-10-05 14:36:22 +02:00

145 lines
2.4 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Installationsvejledning Twitch PHP Bot
## 1⃣ Download
Klon eller hent ZIP fra GitHub:
```
git clone https://github.com/<dit-brugernavn>/twitch-php-bot.git
Placer i din webserver, fx:
makefile
C:\xampp\htdocs\bot\
```
2⃣ Krav
PHP 8.1+
Aktiverede extensions:
pdo_sqlite
curl
mbstring
json
Tjek i php.ini at disse ikke er udkommenteret.
3⃣ Konfiguration
Opret filen .env i projektets rod:
.env
```
TWITCH_CHANNEL=ditkanalnavn
TWITCH_OAUTH=oauth:xxxxxxxxxxxxxxxxxxxx
TWITCH_CLIENT_ID=din_client_id
TWITCH_CLIENT_SECRET=din_client_secret
Hent OAuth-token her: https://twitchapps.com/tmi/
```
4⃣ Database & Admin
Gå til http://localhost/bot/web/migrate_users.php → sikrer korrekte kolonner
Gå til http://localhost/bot/web/create_admin.php → opretter admin
Login:
Brugernavn: admin
Adgangskode: demo
5⃣ Start botten
Åbn http://localhost/bot/web/login.php
Log ind og klik Start
Botten kører i PHP bag kulissen og svarer på chat-kommandoer.
6⃣ (Valgfrit) Live-log via WebSocket
Installer Node.js → kør:
```
npm install ws
node ws_server.js
```
Dashboardet skifter automatisk til WebSocket, hvis tilgængelig.
---
#English
Installation Guide Twitch PHP Bot
##1⃣ Download
Clone or download the ZIP from GitHub:
```
git clone https://github.com/<your-username>/twitch-php-bot.git
```
Place it in your web server directory, for example:
```
C:\xampp\htdocs\bot\
```
<br>
2⃣ Requirements
PHP 8.1+
Enabled extensions:
```
pdo_sqlite
curl
mbstring
json
```
Check your php.ini file and make sure these are not commented out.
3⃣ Configuration
Create a file named .env in the project root:
.env
```
TWITCH_CHANNEL=yourchannelname
TWITCH_OAUTH=oauth:xxxxxxxxxxxxxxxxxxxx
TWITCH_CLIENT_ID=your_client_id
TWITCH_CLIENT_SECRET=your_client_secret
```
Get your OAuth token here: https://twitchapps.com/tmi/
4⃣ Database & Admin
Open:
```
http://localhost/bot/web/migrate_users.php
```
→ ensures correct table columns
Then open:
```
http://localhost/bot/web/create_admin.php
```
→ creates your admin user
Login credentials:
```
Username: admin
Password: demo
```
5⃣ Start the Bot
Go to:
```
http://localhost/bot/web/login.php
```
Log in and click Start
The bot runs in PHP behind the scenes and responds to chat commands.
6⃣ (Optional) Live Log via WebSocket
Install Node.js, then run:
```
npm install ws
node ws_server.js
```
The dashboard will automatically switch to WebSocket mode if available.