bot

package module
v0.0.0-...-0374a7a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2018 License: MIT Imports: 10 Imported by: 0

README

reddit-irc-bot

Donate

Irc bot that posts newest posts from your frontpage or anywhere else

func main() {
    bot.New(bot.Oauth2{
        ClientID: "<your reddit app id>",
        Secret:    "<your reddit app secret>"",
        Developer: "<your reddit username>",
        Password:  "<your reddit password>",
        UserAgent: "<unique user agent (reddit bans generic user agents)>",
    }, bot.Irc{
        IrcNick:    "ircnick123",
        IrcName:    "reddit_bot",
        IrcServer:  "irc.freenode.net:6666",
        IrcChannel: []string{"#testchannel875"},
        IrcTLS:     false,
    }, bot.API{
        Refresh:  time.Minute, // How often check for new posts
        // Api endpoints for your frontpage, can be anything like /r/askreddit/new
        Endpoint: []string{"/new?limit=20", "/r/askreddit/new?limit=20", "/me/m/mymulti/new?limit=20"}
    }).Start()
}

Documentation

Overview

Package bot is Reddit Irc Bot that posts newest reddit posts from your frontpage or any subreddit

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Refresh  time.Duration
	Endpoint []string
}

API settings

type Bot

type Bot struct {
	// contains filtered or unexported fields
}

Bot is a bot construct

func New

func New(oauth Oauth2, irc Irc, api API) *Bot

New creates a new bot object

func (*Bot) Start

func (b *Bot) Start()

Start starts the bot

type Irc

type Irc struct {
	IrcNick    string
	IrcName    string
	IrcServer  string
	IrcChannel []string
	IrcTLS     bool
}

Irc settings

type Oauth2

type Oauth2 struct {
	ClientID  string
	Secret    string
	Developer string
	Password  string
	UserAgent string
}

Oauth2 settings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL