CLI Discord Bot
MIT License
Written in Deno and deployed with Docker.
This is a generalized version of SwiftCompilerDiscordappBot that can be used with various CLIs by configuration.
Set Up Bot Account
Creating a discord bot & getting a token
Required Permissions:
CHANGE_NICKNAME
for update nicknameREAD_MESSAGE_HISTORY
and VIEW_CHANNEL
for update replies on updatingInvite Bot to Your Guild
Open following URL with changing <Client ID>
to your bot's Client ID:
https://discord.com/api/oauth2/authorize?client_id=<Client ID>&scope=bot&permissions=67174400
Run bot on local host using docker compose
export DISCORD_TOKEN="<discord token here>" # discord token
docker compose up
Send mention to Bot
Variable Name | Description | default |
---|---|---|
DOCKER_IMAGE |
Docker image that provides swift on ubuntu | ubuntu:latest |
Variable Name | Description | default |
---|---|---|
DISCORD_TOKEN |
Discord Bot's token | |
DISCORD_NICKNAME |
Discord Nickname |
TARGET_CLI value |
DISCORD_PLAYING |
status for "Playing" |
TARGET_CLI value |
ENV_COMMAND |
Env command launching Timeout command | /usr/bin/env |
ENV_ARGS |
arguments for Env command | -i |
TARGET_CLI |
target CLI | cat |
TARGET_ARGS_TO_USE_STDIN |
arguments for CLI with input | |
TARGET_DEFAULT_ARGS |
arguments for CLI with no arguments | |
TIMEOUT_COMMAND |
Timeout command launching target CLI | timeout |
TIMEOUT_ARGS |
arguments for timeout command | --signal=KILL 30 |
export DISCORD_TOKEN="<discord token here>" # discord token
export DOCKER_IMAGE=swift:latest # docker image
export TARGET_CLI=swift # target cli
export TARGET_ARGS_TO_USE_STDIN=- # swift requires "-" to use stdin as code
docker compose up
export DISCORD_TOKEN="<discord token here>" # discord token
export DOCKER_IMAGE=stedolan/jq:latest # docker image
export TARGET_CLI=jq # target cli
docker-compose up
Norio Nomura
CLI Discord Bot is available under the MIT license. See the LICENSE file for more info.