Code Monkey home page Code Monkey logo

discocat's Introduction

discocat

discocat is a simple commandline utility to post snippets to Discord.

discocat

Quick Start

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

Configuration

  1. Create Discord bot and get bot TokenID in Discord Develper Portal
  2. Get ChannelID that you want to post snippets
  3. 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>"

Building

$ git clone https://github.com/wan-nyan-wan/discocat.git
$ go build

Installation

$ go get -u github.com/wan-nyan-wan/discocat

Usage

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)

Examples

$ 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

References

discocat is greatly inspired by slackcat.

discocat's People

Contributors

dependabot[bot] avatar task4233 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.