discogo

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

discogo

discogo is a package to create a connection as a discord bot.

It's main purpose is to listen to messages and respond accordingly

Getting Started

Installing
go get github.com/tripolious/discogo

You first need to create a discord bot and a token

Usage

Import the package into your project.

import "github.com/tripolious/discogo

You can add as many handlers as you wish in your project to consume events

func handler_x(s *discordgo.Session, m *discordgo.MessageCreate){}
func handler_y(s *discordgo.Session, m *discordgo.MessageCreate){}

var handlers = []interface{}{handler_x,handler_y}
go discogo.Start(ctx, &wg, handlers, *token)
Example

Checkout examples for a working solution

go run examples/listen-and-answer.go --token xxx --channel yyy 

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context, wg *sync.WaitGroup, handlers []interface{}, token string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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