discocat is a simple commandline utility to post snippets to Discord.
Make sure your PATH
includes the $GOPATH/bin
directory.
$ go get -u github.com/wan-nyan-wan/discocat
$ mkdir -p ~/.config
$ cat <<EOF > ~/.config/discocat.yml
default:
BotToken: "<your bot token>"
ChannelID: "<your channel id>"
EOF
$ vim ~/.config/discocat.yml # replace bot token and channel id
$ echo "hello" | discocat
- Create Discord bot and get bot TokenID in Discord Develper Portal
- Get ChannelID that you want to post snippets
- write configuration in
~/.config/discocat.yml
(refereing to discocat.yml.sample`)
The below is a sample configuration. In default, discocat use default
as a bot name. If you want to use others, use --bot
option.
default:
BotToken: "<default bot token>"
ChannelID: "<default channel id>"
bot01:
BotToken: "<bot01 token>"
ChannelID: "<channel01 id>"
bot02:
BotToken: "<bot02 token>"
ChannelID: "<channel02 id>"
$ git clone https://github.com/wan-nyan-wan/discocat.git
$ go build
$ go get -u github.com/wan-nyan-wan/discocat
NAME:
discocat - redirect a file or string to Discord
USAGE:
discocat [global options] command [command options] [arguments...]
VERSION:
v.1.0
AUTHOR:
wan-nyan-wan <[email protected]>
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--list, -l list bot and channel names (default: false)
--bot value, -b value bot name to post (default: "default")
--tee, -t print stdin to screen before posting (default: false)
--help, -h show help (default: false)
--version, -v print the version (default: false)
$ discocat # post stdin(If you want to stop to input, please input Ctrl-D) to the channel via default bot
$ discocat -h # show help
$ discocat -l # show config
$ echo "aiueo" | discocat # post text to the channel via default bot
$ cat test.png | discocat # post image to the channel via default bot
$ echo "hello" | discocat --bot testbot # post testbot
discocat is greatly inspired by slackcat.