Commit 99093c6b authored by AstroSnail's avatar AstroSnail

Fix package names and imports

The things you do when you're new and know nothing!
At this rate @nnnn20430 is gonna be the effective author of most of this code pretty soon :P
parent 1f5b9581
package ABot
package bot
import (
"github.com/AstroSnail/astrobot-go/dbg"
"github.com/AstroSnail/astrobot-go/irc"
"github.com/AstroSnail/astrobot-go/net"
ABdebug "github.com/AstroSnail/astrobot-go/debug"
ABirc "github.com/AstroSnail/astrobot-go/irc"
ABnet "github.com/AstroSnail/astrobot-go/net"
"log"
"strconv"
"sync"
......@@ -15,33 +15,33 @@ func Instance (
wg *sync.WaitGroup,
exiterr *bool,
) {
ABdbg.PrintDebug(id, "Start!")
ABdebug.PrintDebug(id, "Start!")
defer wg.Done()
ABdbg.PrintDebug(id, "Connect!")
ABdebug.PrintDebug(id, "Connect!")
con, err := ABnet.Connect(target)
if err != nil {
*exiterr = true
return
}
ABdbg.PrintDebug(id, "Connected!")
defer ABdbg.PrintDebug(id, "Disconnected!")
ABdebug.PrintDebug(id, "Connected!")
defer ABdebug.PrintDebug(id, "Disconnected!")
defer con.Disconnect()
defer ABdbg.PrintDebug(id, "Disconnect!")
defer ABdebug.PrintDebug(id, "Disconnect!")
log.SetPrefix(strconv.Itoa(id) + " " + target + " ")
sess := ABirc.Session(con)
ABdbg.PrintDebug(id, "Introduce!")
ABdebug.PrintDebug(id, "Introduce!")
err = sess.Introduce(nicknames[0], username, realname)
if err != nil {
*exiterr = true
return
}
ABdbg.PrintDebug(id, "Quit!")
ABdebug.PrintDebug(id, "Quit!")
err = sess.Quit(quitmsg)
if err != nil {
*exiterr = true
......
package ABot
package bot
var (
nicknames = [...]string{"AstroBot", "AstroBot_", "__ASTRO__"}
......
package ABdbg
package debug
import (
"fmt"
......
package ABdbg
package debug
const (
debug = true
......
package main
import (
"github.com/AstroSnail/astrobot-go/dbg"
ABdebug "github.com/AstroSnail/astrobot-go/debug"
"net"
"os"
)
......@@ -11,7 +11,7 @@ var (
)
func init () {
ABdbg.PrintDebug("Init!")
ABdebug.PrintDebug("Init!")
l := len(os.Args) - 1
Targets = make([]string, l)
......
package ABirc
package irc
type why string
......
package ABirc
package irc
func (sess Sender) Introduce (
nickname string,
......
package ABirc
package irc
func (sess Sender) Quit (
quitmsg string,
......
package ABirc
package irc
import (
"github.com/AstroSnail/astrobot-go/net"
ABnet "github.com/AstroSnail/astrobot-go/net"
)
type Sender ABnet.Conn
package ABirc
package irc
import (
"log"
......
package ABirc
package irc
import (
"github.com/AstroSnail/astrobot-go/net"
ABnet "github.com/AstroSnail/astrobot-go/net"
)
func Session (
......
package ABirc
package irc
import (
"strings"
......
package ABirc
package irc
import (
"strings"
......
package ABirc
package irc
import (
"strings"
......
package main
import (
"github.com/AstroSnail/astrobot-go/bot"
"github.com/AstroSnail/astrobot-go/dbg"
ABbot "github.com/AstroSnail/astrobot-go/bot"
ABdebug "github.com/AstroSnail/astrobot-go/debug"
"os"
"sync"
)
func main () {
ABdbg.PrintDebug("Start!")
ABdebug.PrintDebug("Start!")
var wg sync.WaitGroup
......@@ -20,7 +20,7 @@ func main () {
l := len(Targets)
for i := 0; i < l; i++ {
wg.Add(1)
go ABot.Instance(i, Targets[i], &wg, &exiterr)
go ABbot.Instance(i, Targets[i], &wg, &exiterr)
}
wg.Wait()
......
package ABnet
package net
import (
"net"
......
package ABnet
package net
import (
"fmt"
......
package ABnet
package net
import (
"fmt"
......
package ABnet
package net
import (
"time"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment