discord bot node
Prebuilt client for hosting on replit
Discord服務器
Web UI
創建機器人,獲取令牌並添加到Discord服務器
Node.js 16.13.0或需要更新。
在命令行中創建.env文件或設置環境變量,然後將Node_env = production添加到禁用.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存儲庫的發行版中下載。
或與Docker一起運行:
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
Docker Hub
斜線命令是通過不和諧與機器人交互的一種方式。開始鍵入 /查看可用命令的列表。
斜線命令最初必須在“!registerCommands”中註冊。
Web UI可以同時使用多個用戶使用。
<ctrl> + f聚焦搜索<enter>搜索<ctrl> + <enter>立即播放第一個結果<ctrl> + <shift> + <enter>播放第一個結果下一個<shift> + <enter>隊列第一個結果用Firefox&Chrome測試。