- Katılım
- 23 Eki 2022
- Mesajlar
- 7,872
- Çözümler
- 12
- Tepkime puanı
- 4,562
- Puanları
- 113
- Yaş
- 28
Ein robuster und funktionsreicher Discord-Bot zur Verwaltung von Benachrichtigungen, zur Verfolgung von Spielerzahlen und zur Ausführung dynamischer Befehle.
Der Bot wurde mit Fokus auf Modularität und Skalierbarkeit entwickelt und integriert sich problemlos in Datenbanken. Durch die Nutzung der Discord API verbessert er die Community-Interaktion erheblich.
Perfekt geeignet für Gaming-Communities wie Classic Silkroad Online.
Abhängigkeiten installieren
npm install
.env Datei erstellen
CLIENT_ID=
DISCORD_BOT_TOKEN=
DISCORD_CHANNEL_ID=
DISCORD_ONLINE_PLAYERS_CHANNEL_ID=
DISCORD_TOTAL_PLAYERS_CHANNEL_ID=
DISCORD_LOG_CHANNEL_ID=
DB_HOST=
DB_USER=
DB_PASSWORD=
DB_NAME=
SHARD_DB_NAME=SRO_VT_SHARD
NOTIFICATION_POLLING_INTERVAL=5000
PLAYER_COUNT_POLLING_INTERVAL=30000
GUILD_IDS=
AUTHORIZED_USERS=
Bot starten
node bot.js
/ADDGOLD [charname] [amount]
/CHECKGOLD [charname]
/ADDSILK [charname] [amount]
/CHECKSILK [charname]
INSERT INTO notifications (type, title, description, image_url)
VALUES (
'image',
'Neue Server Features!',
'Schau dir unsere Updates an...',
'IMAGE_URL'
);
INSERT INTO notifications (type, title, description, yt_url)
VALUES (
'youtube',
'Neue Server Features!',
'Schau dir unsere Updates an...',
'YOUTUBE_URL'
);
project-directory
┣
commands
┣
handlers
┣
utils
┣
bot.js
┣
functions.js
┣
deploy-commands.js
┣
.env
┗
package.json
NOTIFICATION_POLLING_INTERVAL=5000
PLAYER_COUNT_POLLING_INTERVAL=30000
Der Bot wurde mit Fokus auf Modularität und Skalierbarkeit entwickelt und integriert sich problemlos in Datenbanken. Durch die Nutzung der Discord API verbessert er die Community-Interaktion erheblich.
Perfekt geeignet für Gaming-Communities wie Classic Silkroad Online.
Funktionen
Benachrichtigungssystem
- Ruft automatisch Bilder und Videos aus der Datenbank ab
- Sendet Inhalte direkt an Discord
- Markiert gesendete Benachrichtigungen automatisch
Spieleranzahl-Tracking
- Zeigt Live Online-Spieler
- Zeigt Gesamt-Spieleranzahl
- Aktualisiert Discord-Kanalnamen automatisch
Befehls-System
- Anpassbare Commands im commands Ordner
- Unterstützt globale und server-spezifische Befehle
Logging
- Erweiterte Logs mit Winston
- Ideal für Debugging und Monitoring
.env Unterstützung
- Schnelle und einfache Konfiguration
Installation
Voraussetzungen
- Node.js (v16.6 oder höher)
- npm
- Microsoft SQL Server
Einrichtung
Abhängigkeiten installieren
npm install
.env Datei erstellen
CLIENT_ID=
DISCORD_BOT_TOKEN=
DISCORD_CHANNEL_ID=
DISCORD_ONLINE_PLAYERS_CHANNEL_ID=
DISCORD_TOTAL_PLAYERS_CHANNEL_ID=
DISCORD_LOG_CHANNEL_ID=
DB_HOST=
DB_USER=
DB_PASSWORD=
DB_NAME=
SHARD_DB_NAME=SRO_VT_SHARD
NOTIFICATION_POLLING_INTERVAL=5000
PLAYER_COUNT_POLLING_INTERVAL=30000
GUILD_IDS=
AUTHORIZED_USERS=
Bot starten
node bot.js
Commands
/ADDGOLD [charname] [amount]
/CHECKGOLD [charname]
/ADDSILK [charname] [amount]
/CHECKSILK [charname]
Notification Gönderme
Resim Bildirimi
INSERT INTO notifications (type, title, description, image_url)
VALUES (
'image',
'Neue Server Features!',
'Schau dir unsere Updates an...',
'IMAGE_URL'
);
YouTube Bildirimi
INSERT INTO notifications (type, title, description, yt_url)
VALUES (
'youtube',
'Neue Server Features!',
'Schau dir unsere Updates an...',
'YOUTUBE_URL'
);
Projektstruktur
project-directory┣
commands┣
handlers┣
utils┣
bot.js┣
functions.js┣
deploy-commands.js┣
.env┗
package.json
Hauptfunktionen
Notification System
- Neue Datenbank kayıtlarını otomatik çeker
- Discord'a gönderir
Player Tracking
- Online ve total oyuncuları çeker
- Kanal isimlerini günceller
Command System
- Slash command desteği
- Hızlı deploy sistemi
Anpassung
Polling süresi değiştirme
NOTIFICATION_POLLING_INTERVAL=5000
PLAYER_COUNT_POLLING_INTERVAL=30000
Yeni command ekleme
- /commands klasörüne yeni dosya ekle
- data ve execute export et
Fehlerbehebung
Datenbank hatası
- DB bilgilerini kontrol et
- Tablolar mevcut mu bak
Bot çalışmıyor
- Discord izinlerini kontrol et
- Bot aktif mi bak
Commands çalışmıyor
- CLIENT_ID ve TOKEN doğru mu
Log kontrol
- bot.log dosyasını incele
İçeriği görüntülemek için Giriş yapın veya Kayıt olun.
