~kris/9p

glenda

e796683ffcaaad1bdc5f388e863d3748778a1383 — Sean Hinchee 7 years ago 3c742e5 + 2aef248
Merged in amavect/glenda (pull request #1)

g!newuser
3 files changed, 45 insertions(+), 14 deletions(-)

M README.md
M mux.go
A x/mux/newuser.go
M README.md => README.md +4 -2
@@ 1,6 1,8 @@
# Glenda Bot
Dis**go**rd is an example of or starting point for creating an easy to use and 
extensible Discord bot using the [DiscordGo](https://github.com/bwmarrin/discordgo) 
Glenda is the 9fans friendly neighborhood rabbit. 

Glenda was made using the [Dis**go**rd](https://github.com/bwmarrin/disgord) 
template of the [DiscordGo](https://github.com/bwmarrin/discordgo) 
library.

### Dependencies

M mux.go => mux.go +14 -12
@@ 18,10 18,24 @@ func init() {
	// Register the build-in help command.
	Router.Route("help", "Display this message.", Router.Help)

	Router.Route("about", "General information about the bot.", Router.About)
	
	Router.Route("newuser", "Information for new users of Plan 9.", Router.Newuser)
	
	Router.Route("remindme", "Set a reminder for a given time interval ([int][hmsd] [reminder]).", Router.RemindMe)
	
	Router.Route("man", "Link a given Plan 9 manual page (From 9front for now).", Router.Man)

	Router.Route("lookman", "Search for a string in the Plan 9 manual pages (From 9front for now).", Router.Lookman)

	Router.Route("fortune", "Display fortunes. Bonus files are (theo troll rsc terry rob ken).", Router.Fortunes)
	
	Router.Route("bullshit", "Print logical statements with sound grounding.", Router.Bullshit)
	
	Router.Route("add", "Track an RSS feed.", Router.Add)
	
	Router.Route("remove", "Remove a tracked RSS feed by ID.", Router.Remove)
	
	Router.Route("list", "List RSS feeds Glenda is subscribed to by id.", Router.List)
	
	Router.Route("last", "Show the last commit for a given RSS feed by id.", Router.Last)


@@ 34,21 48,9 @@ func init() {
	
	Router.Route("unsubscribe", "Unsubscribe current channel to a given feed id.", Router.Unsubscribe)
	
	Router.Route("man", "Link a given Plan 9 manual page (From 9front for now).", Router.Man)

	Router.Route("lookman", "Search for a string in the Plan 9 manual pages (From 9front for now).", Router.Lookman)

	Router.Route("about", "General information about the bot.", Router.About)
	
	Router.Route("beer", ":beer:", Router.Beer)
	
	Router.Route("whiskey", ":tumbler_glass:", Router.Whiskey)
	
	Router.Route("wine", ":wine_glass:", Router.Wine)
	
	Router.Route("remindme", "Set a reminder for a given time interval ([int][hmsd] [reminder]).", Router.RemindMe)
	
	Router.Route("bullshit", "Print logical statements with sound grounding.", Router.Bullshit)
	
	Router.Route("remove", "Remove a tracked RSS feed by ID.", Router.Remove)
}

A x/mux/newuser.go => x/mux/newuser.go +27 -0
@@ 0,0 1,27 @@
package mux

import (
	"github.com/bwmarrin/discordgo"
)

// Help for newbies. :D
func (m *Mux) Newuser(ds *discordgo.Session, dm *discordgo.Message, ctx *Context) {
	resp := ""
	resp += `Welcome to 9fans! Here's an introduction and resources for Plan 9 and 9front.
In this community, you are expected to read the docs and man pages.
However, don't be afraid to ask for help and clarification!
Install 9front: http://9front.org/ http://fqa.9front.org/
Beginner's guides: http://lsub.org/who/nemo/9.intro.pdf http://fqa.9front.org/fqa8.html
Read the man pages: http://man.9front.org/ (also use 'man [page name]' or 'lookman [keyword]')
Read the docs: http://doc.cat-v.org/plan_9/4th_edition/papers/ (also found in /sys/doc, use 'page [file]')
Wiki for additional help: https://9p.io/wiki/plan9/plan_9_wiki/ (some info may be outdated)"
Miscellaneous Plan 9 websites: http://blog.postnix.us/ https://code.9front.org/hg/
http://9gridchan.org/ http://felloff.net/usr/cinap_lenrek/
	`
	resp += "\n"

	ds.ChannelMessageSend(dm.ChannelID, resp)

	return
}