Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

deltaryz
Copy link
Collaborator

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)

@@ -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" {
Copy link
Member

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.

@@ -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" {
Copy link
Member

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")
Copy link
Member

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,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants