goradbot

package module
v0.0.0-...-36a50f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2020 License: MIT Imports: 12 Imported by: 0

README

Go Build Status

GoRadBot

Radio bot player for Discord. Made by Patricio Pérez (me) for PAWA.cl. Built in Go 1.14.

Why a bot?

Well, right now there a so many bots used for music player in Discord, but i found the following problems:

  • Some of the players don't have support for external links, because of security measures (which are fine, i can understand it).
  • Others only offer this as a premium feature.
  • Others are a little laggy, or have a latency, causing that the music sounds chopped, or incomplete.
  • Others, offer radio as part of a very large suite with other unnecessary commands.
  • And finally, most of them offer no open-source alternatve.

But there are options!

Yeah! There is a popular option, Fredboat, that is implemented in Java. The problem: I need to run this in a very cheap alternative (like, a raspberry), so the memory usage is crucial.

And then, Gopher speaks

Well, since i'm interested to develop this as quick as possible, the most reasonable option (for me) was Golang. There are many libraries for Golang, that there is already one that supports Discord and also mp3 plays!

Features

This initial release has only the basic support:

  • A Helper command.
  • Bot Token configuration through a YAML file.
  • Embed templates for the bot, written in YAML for convenience.
  • Obviously, a play url/stop feature.

Requirements

For the current implementation, you need to install ffmpeg. This is used for the mp3 conversion to dca.

For developing

If you want to test it in your workspace, then you also need to install the following go packages (if you have problems with go mod):

go get -u github.com/bwmarrin/discordgo
go get -u github.com/ghodss/yaml
go get -u github.com/jonas747/dca

Improvements

Since this is an initial release, there are many things to solve and document, so i'll keep improving during the following weeks. But, for now, here are my TODO's

  • Add Documentation in Wiki
  • Polish templates
  • Write tutorial for initial Discord Users
  • Add Session support
  • Make a docker file

Additional Goals

  • Launch a bot officially in top.gg
  • ?
  • Profit

Support the maintainer

Finally, if you think that my effort deserves a prize, or if you want to help to keep me motivated, i'll be always grateful if you can support the project. Please check the Sponsor button! Thanks in advance.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(token string)

Start initialize the bot.

Types

type RegexMap

type RegexMap struct {
	MappedResult map[string]string
}

RegexMap is a map for the regular expression method

func (*RegexMap) Matches

func (r *RegexMap) Matches(regEx, str string) bool

Matches checks if expression match any substring and saves the mapped result.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL