Categorygithub.com/rivalo/discord-cli
modulepackage
0.3.0-alpha
Repository: https://github.com/rivalo/discord-cli.git
Documentation: pkg.go.dev

# README

discord-cli

Minimalistic Command-Line Interface for Discord

Master (Semi-Stable): Build Status, Develop (Default Git Branch): Build Status

Join our Discord Chat! https://discord.gg/0pXWCo5RQbVuFHDM

I suck at English, while 256 colors is enough for everyone

Disclaimer: Currently only tested on Linux. It also looks pretty bad in its current state.

How to Install the Master branch?

Currently the easiest working way to install is to use the Go tools. I'm looking at using GCCGO and makefiles to reduce installation steps, and make setting PATHS unnecessary.

  • Install the Go Tools and setup the $GOPATH (There are loads of tutorial for this part)
  • $ go get -u github.com/Rivalo/discord-cli
  • Go to the bin folder inside your $GOPATH
  • ./discord-cli

For trying the develop branch, do a git checkout and reinstall the application.

(Master) Configuration Settings

Configuration files are being stored in JSON format and are automatically created when you first run discord-cli. Do not change the 'key' value inside {"key":"value"}, this is the part that discord-cli uses for parsing, missing keys will definitely return errors.

SettingFunction
usernameDiscord Username (emailaddress)
passwordDiscord Password
guildDefault Discord Server (Currently null because this function does not work yet)
channelDefault Discord Text Channel (Currently null because this function does not work yet)

NOTE: The Configuration settings are likely to change. Breaking updates are stated in the release section. To solve problems, delete ~/.config/discord-cli/config.json and restart discord-cli.

(Master) Chat Commands

When inside a text channel, the following commands are available:

CommandFunction
:qQuits discord-cli
:d'Disconnect' Guild and go back to selection menu
:cChange listening Channel inside Guild

# Functions

CheckState checks the current state for essential missing information, errors will fail the program.
Clear clears the terminal => This barely works, please fix.
CreateConfig creates folder inside $HOME and makes a new empty configuration file.
ExtraGuildMenuOptions prints and handles extra options for SelectGuildMenu.
GetConfig retrieves configuration file from ~./config/discord-cli, if it doesn't exist it calls CreateConfig().
Header simply prints a header containing state/session information.
InitWindow creates a New CLI Window.
LeaveServerMenu is a copy of SelectGuildMenu that leaves instead of selects.
Msg is a composition of Color.New printf functions.
ParseForCommands parses input for Commands, returns message if no command specified, else return is empty.
ParseForMentions parses input string for mentions.
PrintMessages prints amount of Messages to CLI.
ReceivingMessageParser parses receiving message for mentions, images and MultiLine and returns string array.
ReplaceMentions replaces mentions to ID.
SelectChannel selects a new Channel.
SelectChannelMenu is a menu item that sets the current channel.
SelectGuild selects a new Guild.
SelectGuildMenu is a menu item that creates a new State on basis of Guild selection.
ShowContent shows defaulth Channel content.

# Constants

Global Message Types.
Global Message Types.
Global Message Types.
Global Message Types.
Version is current version const.

# Variables

Config is the global configuration of discord-cli.
Session is global Session.
State is global State.

# Structs

Configuration is a struct that contains all configuration fields.

# Type aliases

MsgType is a string containing global message type.