A lightweight Discord music bot written in go with minimal dependencies. Optimized for low CPU (not RAM) usage and responsive playback. Directly uses youtube-dl and ffmpeg for downloading media.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

16 lines
462 B

// Parses the commands sent through Discord. This program does not use any
// traditional command line options, as it uses config.json for configuration.
package main
import (
// Returns a false and a nil slice if cmd was not intended for the bot.
func CmdGetArgs(cmd string) (args []string, ok bool) {
if !strings.HasPrefix(cmd, cfg.Prefix) {
return nil, false
cmd = strings.TrimPrefix(cmd, cfg.Prefix)
return strings.Fields(cmd), true