File tree 3 files changed +11
-4
lines changed
3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,11 @@ func GetWebhook(ctx *macaron.Context) {
16
16
json .Unmarshal (body , & res )
17
17
18
18
modules .BOT .ChannelMessageSend (modules .CONFIG .Section ("DISCORD" ).Key ("channel" ).String (),
19
- "[" + res .Repo .Name + "] " + res .Pusher .Name + " pushed " + len (res .Commits ) + " commits to " + res .Ref + "<" + res .Compare + ">" )
19
+ "[" + * res .Repo .Name + "] " + * res .Pusher .Name + " pushed " + string (len (res .Commits )) + " commits to " + * res .Ref +
20
+ "<" + * res .Compare + ">" )
20
21
for _ , commit := range res .Commits {
21
22
modules .BOT .ChannelMessageSend (modules .CONFIG .Section ("DISCORD" ).Key ("channel" ).String (),
22
- res .Repo .Name + "/" + res .Ref + " " + commit .SHA + ": " + commit .Message + " (By " + commit .Author .Name + ")" )
23
+ * res .Repo .Name + "/" + * res .Ref + " " + * commit .SHA + ": " + * commit .Message + " (By " + * commit .Author .Name + ")" )
23
24
}
24
25
}
25
26
}
Original file line number Diff line number Diff line change 4
4
"github.com/lexteam/lexbot/controllers"
5
5
"github.com/lexteam/lexbot/modules"
6
6
"gopkg.in/macaron.v1"
7
+ "fmt"
7
8
)
8
9
9
10
func main () {
@@ -19,4 +20,10 @@ func main() {
19
20
20
21
// Lets run
21
22
s .Run (modules .CONFIG .Section ("SERVER" ).Key ("port" ).Int ())
23
+
24
+ err := modules .BOT .Open ()
25
+ if err != nil {
26
+ fmt .Println ("error opening connection" , err )
27
+ return
28
+ }
22
29
}
Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ func InitBot() {
14
14
15
15
BOT , err = discordgo .New (
16
16
CONFIG .Section ("DISCORD" ).Key ("email" ).String (),
17
- CONFIG .Section ("DISCORD" ).Key ("password" ).String (),
18
- CONFIG .Section ("DISCORD" ).Key ("token" ).String ())
17
+ CONFIG .Section ("DISCORD" ).Key ("password" ).String ())
19
18
if err != nil {
20
19
fmt .Println ("Error creating Discord session" , err )
21
20
}
You can’t perform that action at this time.
0 commit comments