Compare commits
2 Commits
130d1c573f
...
v0.6.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
a07c071dc2
|
|||
|
b9ec31da95
|
@@ -38,7 +38,7 @@ auto-moderation from the bot without manual intervention. The example message ha
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
b, err := bolt.New(bolt.WithLogLevel(bolt.LogLevelAll))
|
b, err := bolt.New()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|||||||
7
bolt.go
7
bolt.go
@@ -112,8 +112,6 @@ func (b *bolt) Start() error {
|
|||||||
return fmt.Errorf("failed to open websocket connection with Discord: %e", err)
|
return fmt.Errorf("failed to open websocket connection with Discord: %e", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("bot started")
|
|
||||||
|
|
||||||
sigChannel := make(chan os.Signal, 1)
|
sigChannel := make(chan os.Signal, 1)
|
||||||
signal.Notify(sigChannel, os.Interrupt)
|
signal.Notify(sigChannel, os.Interrupt)
|
||||||
<-sigChannel
|
<-sigChannel
|
||||||
@@ -131,10 +129,8 @@ func (b *bolt) Start() error {
|
|||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
log.Println("shutdown timed out waiting for handlers to finish, some may have been incomplete")
|
log.Println("shutdown timed out waiting for handlers to finish, some may have been incomplete")
|
||||||
case <-closeChan:
|
case <-closeChan:
|
||||||
log.Println("handler routines cleaned")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("exiting")
|
|
||||||
return b.stop()
|
return b.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,9 +153,6 @@ func (b *bolt) stop() error {
|
|||||||
return b.Close()
|
return b.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// msgEventHandler is a beefy boy that handles message logging, command parsing, and executing payload functions. It needs cleanup then
|
|
||||||
// i'll worry about this comment
|
|
||||||
|
|
||||||
// msgEventHandler handles the routing of messages to either the command or message handlers. If LogLvl is set, logging is handled here before
|
// msgEventHandler handles the routing of messages to either the command or message handlers. If LogLvl is set, logging is handled here before
|
||||||
// the event is mapped to the Message struct and forwarded to the handlers. Each message is handled in its own goroutine, the max allowed goroutines
|
// the event is mapped to the Message struct and forwarded to the handlers. Each message is handled in its own goroutine, the max allowed goroutines
|
||||||
// is set as a default and can be altered using options for better performance.
|
// is set as a default and can be altered using options for better performance.
|
||||||
|
|||||||
Reference in New Issue
Block a user