discord bot node
Prebuilt client for hosting on replit
Discordサーバー
Web UI
ボットを作成し、トークンを取得し、Discordサーバーに追加します
node.js 16.13.0以降が必要です。
CommandLineで.ENVファイルまたは設定環境変数を作成し、node_env =生産を追加して、disable .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(開発用)を介して常にサーバーにアクセスします。
レプリットは、自分用にボットを展開するための無料で簡単な方法です。
このプロジェクトは、レプリット用に設計されていません。提供された構成は、それを展開することのみを目的としています。
無料版を使用すると、利用可能なリソースによって制限される場合があります。クライアントはRAMがなくなるため、構築できません。このため、クライアントはこのGit Repoのリリースから自動的にダウンロードされます。
または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ハブ
スラッシュコマンドは、不一致を介してボットと対話する方法です。入力を開始 /利用可能なコマンドのリストを表示します。
スラッシュコマンドは、最初に「!RegisterCommands」に登録する必要があります。
Web UIは、複数のユーザーが同時に使用できます。
<ctrl> + fフォーカス検索<enter>検索<ctrl> + <enter>最初に結果を再生します<ctrl> + <shift> + <enter>次に最初の結果を再生します<shift> + <enter>キューの最初の結果Firefox&Chromeでテストしました。