-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reddit grabber function & techgore command #11
base: master
Are you sure you want to change the base?
Conversation
cmd/aerial/pvfm.go
Outdated
@@ -224,6 +224,10 @@ func streams(s *discordgo.Session, m *discordgo.Message, parv []string) error { | |||
} | |||
|
|||
func derpi(s *discordgo.Session, m *discordgo.Message, parv []string) error { | |||
if m.ChannelID != "292755043684450304" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this a configuration setting using an environment variable.
cmd/aerial/pvfm.go
Outdated
@@ -236,3 +240,16 @@ func derpi(s *discordgo.Session, m *discordgo.Message, parv []string) error { | |||
s.ChannelMessageSend(m.ChannelID, "http:"+searchResults.Search[randomRange(0, len(searchResults.Search))].Image) | |||
return nil | |||
} | |||
|
|||
func techgore(s *discordgo.Session, m *discordgo.Message, parv []string) error { | |||
if m.ChannelID != "193740418633039872" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make this a configuration setting using an environment variable.
listOptions := geddit.ListingOptions{ | ||
Limit: 50, | ||
} | ||
reddit := geddit.NewSession("discordbot") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/reddit/reddit/wiki/API#rules
Prefer something like
const (
appid = "github.com/PonyvilleFM/aura/cmd/aerial"
version = "0.1"
)
userAgent := fmt.Sprintf(
"%s on %s %s:%s:%s (by /u/shadowh511)",
runtime.Version(), runtime.GOOS, runtime.GOARCH,
appid, version,
)
Techgore only works in #nerdery, function is modularized to allow other subreddit grabs
Does not log in with any login or API key (reddit doesn't require one for these kinds of simple grabs)