เซิร์ฟเวอร์ Discord
เว็บ UI
สร้างบอทรับโทเค็นและเพิ่มลงในเซิร์ฟเวอร์ Discord
จำเป็นต้องใช้ node.js 16.13.0 หรือใหม่กว่า
สร้างไฟล์. ENV หรือตั้งค่าตัวแปรสภาพแวดล้อมใน CommandLine และเพิ่ม NODE_ENV = การผลิตเพื่อปิดการใช้งานไฟล์. ENV
TOKEN=<discord token>
OWNER=<Discord owner User Id>
URL=<url/ip of this server in format http(s)://foo.bar:port>
PORT=<port to start server on, default: 3000>
DEFAULT_VOLUME=<0-150, default: 20>
RADIO_MAX_VIDEO_LENGTH=<length in seconds, 0 for no max length, default: 600, will exclude all songs longer than the duration from the radio.>
AUTO_LEAVE_TIMEOUT=<length in seconds, -1 to disable, Default: 60, will make the bot leave after the given amount of time, if he is alone.>
RESUME_ON_BOT_JOIN=<true/false, default: false, whether the bot resumes music playback when he joins a channel.>
PAUSE_ON_USER_LEAVE<true/false, default: true, whether the bots pauses music playback when he is alone.>
RESUME_ON_USER_JOIN=<true/false, default: true, whether the bots resumes music playback when he is no longer alone.>
สร้างเซิร์ฟเวอร์ก่อนจากนั้นไคลเอนต์
> npm install
> npm run build
client> npm install
client> npm run build:prod
> node ./bin/www
หากไคลเอนต์ถูกสร้างโดยไม่มีธง PROD มันจะเข้าถึงเซิร์ฟเวอร์ผ่าน LocalHost: 3000 (เพื่อการพัฒนา)
Replit เป็นวิธีที่ง่ายและง่ายในการปรับใช้บอทด้วยตัวคุณเอง
โครงการนี้ไม่ได้ออกแบบมาเพื่อแก้ไข การกำหนดค่าที่ให้ไว้นั้นหมายถึงการปรับใช้เท่านั้น
ด้วยเวอร์ชันฟรีคุณอาจถูก จำกัด ด้วยทรัพยากรที่มีอยู่ ลูกค้าไม่สามารถสร้างได้เพราะมันจะหมดจาก RAM ด้วยเหตุนี้ไคลเอนต์จะถูกดาวน์โหลดโดยอัตโนมัติจากการเปิดตัวของ git repo นี้
หรือเรียกใช้กับนักเทียบท่า:
docker run -d -p 80:80 --restart unless-stopped --name discord-bot-node -e NODE_ENV=production -e PORT=80 -e TOKEN=<discord token> -e OWNER=<discord owner id> -e URL=<url/ip e.g http(s)://foo.bar:port> alexanderwyss/discord-bot-node:latest
นักเทียบท่า
คำสั่งสแลชเป็นวิธีการโต้ตอบกับบอทผ่าน Discord เริ่มพิมพ์ / เพื่อดูรายการคำสั่งที่มีอยู่
คำสั่ง Slash จะต้องลงทะเบียนด้วย "! registercommands" ในขั้นต้น
เว็บ UI สามารถใช้งานได้โดยผู้ใช้หลายคนพร้อมกัน
<ctrl> + f การค้นหาโฟกัส<enter> ค้นหา<ctrl> + <enter> เล่นผลลัพธ์แรกทันที<ctrl> + <shift> + <enter> เล่นผลลัพธ์แรกถัดไป<shift> + <enter> ผลลัพธ์แรกทดสอบกับ Firefox & Chrome