~kris/9p

glenda

ref: ac5d697efa679487ceda0658945cf5653eaf35ed glenda/x/mux/commits.go -rw-r--r-- 755 bytes
ac5d697e — Sean Hinchee migrated config to mux, this makes more sense 8 years ago
                                                                                
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
39
40
41
42
43
package mux

import (
	"github.com/bwmarrin/discordgo"
	"github.com/SlyMarbo/rss"
	"fmt"
	"time"
)

/* internal functions */

// Listen on the rss feed
func Listener() {
	feed, err := rss.Fetch("http://code.9front.org/hg/plan9front/rss-log")
	if err != nil {
		fmt.Println("Error in reading RSS feed, see: x/mux/commits.go")
		fmt.Printf("%s\n\n", err)
	}

	time.Sleep(1000 * time.Second)

	err = feed.Update()
	if err != nil {
		fmt.Println("Error in updating RSS feed, see: x/mux/commits.go")
		fmt.Printf("%s\n\n", err)
	}
}

/* Commands for Mux */

// Print last commit or 
func (m *Mux) Commits(ds *discordgo.Session, dm *discordgo.Message, ctx *Context) {
	resp := "```\n"



	resp += "```\n"

	ds.ChannelMessageSend(dm.ChannelID, resp)

	return
}