#cli

bin+lib guild

Guild is a Command Line Interface build with Rust that posts code snippets to a Discord channel using Webhooks

5 releases

0.2.1 Mar 2, 2021
0.2.0 Jan 6, 2021
0.1.3 Jan 4, 2021

#881 in Command line utilities

Download history 18/week @ 2021-03-31 8/week @ 2021-04-07 20/week @ 2021-04-14 5/week @ 2021-04-21 7/week @ 2021-04-28 7/week @ 2021-05-12 1/week @ 2021-05-19 6/week @ 2021-06-09 1/week @ 2021-06-23 1/week @ 2021-06-30 6/week @ 2021-07-14

51 downloads per month

MIT license

15KB
136 lines

guild

Guild is a Command Line Utility that allows you to post code snippets from a file to a Discord channel.

How does it work?

By utilizing Serentiy to access the Discord API, guild communicates with your Discord server using Webhooks. This allows guild to post a message to Discord on its own without having to type anything into Discord itself.

Download

Install Rust

In order to download guild, you need to have Rust downloaded on your computer if you don't already. To install Rust, go to the Rust website and follow the instructions.

Install guild

Once Rust is installed on your machine, you must install guild through Cargo:

cargo install guild

Usage

  1. Create a Discord Webhook in the desired server
  2. Copy the Discord Webhook URL and execute the following command in your terminal
    guild set <webhook url>
    
  3. Post your desired code snippet to the Discord server:
    guild post <file path> <starting line> <ending line>
    
    • If you would like the code snippet to have syntax highlighting, add the following flag at the end of your command:
      guild post <file path> <starting line> <ending line> -H
      
      or
      guild post <file path> <starting line> <ending line> --highlight
      
    • Example:
      guild post main.c 1 5 -H
      

Commands

  • set: Set the Discord Webhook URL
  • post: Post a code snippet to the set Discord channel

Flags

  • help: See the possible commands and flags that are supported by guild
  • highlight: Enable syntax highlighting for the code snippet

Dependencies

~8.5MB
~153K SLoC