-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterfaces.go
38 lines (33 loc) · 1.15 KB
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"github.com/bwmarrin/discordgo"
"github.com/jamestjw/lyrical/voice"
)
// Session that represents current session of discord bot
type Session interface {
CloseConnection() error
ListenAndServe() error
AddHandler(interface{}) func()
}
// Event is an interface for a discord message event
type Event interface {
SendMessage(message string) *discordgo.Message
SendMessageWithMentions(message string, userIDs []string) *discordgo.Message
FindVoiceChannel(channelName string) (channelID string, err error)
GetSession() voice.Connectable
GetGuildID() string
GetVoiceConnection() (voice.Connection, bool)
GetMessageByMessageID(messageID string) (*discordgo.Message, error)
React(emoji string)
ReactToMessage(emoji string, messageID string)
SendQuotedMessage(quote string, message string) *discordgo.Message
SendQuotedMessageWithMentions(quote string, message string, userIDs []string) *discordgo.Message
GetReactionsFromMessage(messageID string) (map[string][]string, error)
GetUserForBot() (*discordgo.User, error)
}
type Searcher interface {
GetVideoID(string) (string, error)
}
type botSession struct {
session *discordgo.Session
}