kill bot after 10 minutes idling
should prevent 'ping loss' due to weird network setup
This commit is contained in:
parent
9e09e78ab8
commit
f6cf8b46ec
8 changed files with 187 additions and 230 deletions
34
types.go
Normal file
34
types.go
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"net"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Name string `cfg:"name; boddle; printableascii; IRC nick of bot"`
|
||||
Channels []string `cfg:"channels; required; printableascii; Channel list to join to"`
|
||||
Server string `cfg:"server; required; netaddr; Server name to connect to"`
|
||||
Database string `cfg:"database; ./boddle.db; path; Path to database"`
|
||||
}
|
||||
|
||||
type irc_msg struct {
|
||||
channel string
|
||||
msg string
|
||||
author string
|
||||
retmsg string
|
||||
}
|
||||
|
||||
type cmd struct {
|
||||
valid bool
|
||||
add bool
|
||||
cmd string
|
||||
groups []string
|
||||
suffix string
|
||||
error string
|
||||
}
|
||||
|
||||
type bot struct {
|
||||
Conf Config
|
||||
conn net.Conn
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue