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测试。