professional retard coming through
commit
d1d0f162e8
@ -0,0 +1 @@
|
||||
config.yaml
|
@ -0,0 +1,12 @@
|
||||
module git.freecumextremist.com/grumbulon/millionsmustbot
|
||||
|
||||
go 1.19
|
||||
|
||||
require github.com/mattn/go-mastodon v0.0.6
|
||||
|
||||
require (
|
||||
github.com/gorilla/websocket v1.5.0 // indirect
|
||||
github.com/stefansundin/go-zflag v1.1.1
|
||||
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
@ -0,0 +1,11 @@
|
||||
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
||||
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/mattn/go-mastodon v0.0.6 h1:lqU1sOeeIapaDsDUL6udDZIzMb2Wqapo347VZlaOzf0=
|
||||
github.com/mattn/go-mastodon v0.0.6/go.mod h1:cg7RFk2pcUfHZw/IvKe1FUzmlq5KnLFqs7eV2PHplV8=
|
||||
github.com/stefansundin/go-zflag v1.1.1 h1:XabhzWS588bVvV1z1UctSa6i8zHkXc5W9otqtnDSHw8=
|
||||
github.com/stefansundin/go-zflag v1.1.1/go.mod h1:HXX5rABl1AoTcZ2jw+CqJ7R8irczaLquGNZlFabZooc=
|
||||
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y=
|
||||
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
@ -0,0 +1,44 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/mattn/go-mastodon"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
AccessToken string
|
||||
Instance string
|
||||
}
|
||||
|
||||
func Post(cfg Config) {
|
||||
|
||||
c := mastodon.NewClient(&mastodon.Config{
|
||||
Server: cfg.Instance,
|
||||
AccessToken: cfg.AccessToken,
|
||||
})
|
||||
post := MakeWords()
|
||||
_, err := c.PostStatus(context.Background(), &mastodon.Toot{
|
||||
Status: post,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
}
|
||||
|
||||
func GetAuthStuff() (*Config, error) {
|
||||
var config Config
|
||||
|
||||
data, err := os.ReadFile("./config.yaml")
|
||||
if err != nil {
|
||||
return &Config{}, err
|
||||
}
|
||||
err = yaml.Unmarshal(data, &config)
|
||||
if err != nil {
|
||||
return &Config{}, err
|
||||
}
|
||||
return &config, nil
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
func MakeWords() string {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
|
||||
rng := rand.Intn(len(AllWords) - 1)
|
||||
rng2 := rand.Intn(len(Numsers) - 1)
|
||||
|
||||
return fmt.Sprintf("%s Must %s", Numsers[rng2], AllWords[rng])
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
flag "github.com/stefansundin/go-zflag"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
Init bool
|
||||
}
|
||||
|
||||
func ParseCLI(args []string, version string) (*Options, error) {
|
||||
flagSet := flag.NewFlagSet(args[0], flag.ContinueOnError)
|
||||
|
||||
flagSet.Usage = func() {
|
||||
fmt.Println(`Millions Must Die
|
||||
|
||||
Usage: mmd
|
||||
|
||||
mmd -i -- this will create your credentials
|
||||
|
||||
Options:`)
|
||||
flagSet.PrintDefaults()
|
||||
}
|
||||
|
||||
var (
|
||||
Init = flagSet.Bool("init", false, "inits new auth", flag.OptShorthand('i'))
|
||||
)
|
||||
|
||||
// Don't sort the flags when -h is given
|
||||
flagSet.SortFlags = false
|
||||
|
||||
// Parse the flags
|
||||
if err := flagSet.Parse(args[1:]); err != nil {
|
||||
return &Options{}, fmt.Errorf("flag: %w", err)
|
||||
}
|
||||
|
||||
opts := Options{
|
||||
Init: *Init,
|
||||
}
|
||||
|
||||
return &opts, nil
|
||||
}
|
@ -0,0 +1,243 @@
|
||||
package internal
|
||||
|
||||
var AllWords = []string{
|
||||
"Ai",
|
||||
"Ay",
|
||||
"Aye",
|
||||
"Bae",
|
||||
"Bi",
|
||||
"Bligh",
|
||||
"Bly",
|
||||
"Buy",
|
||||
"By",
|
||||
"Bye",
|
||||
"Cai",
|
||||
"Chae",
|
||||
"Chai",
|
||||
"Chi",
|
||||
"Cry",
|
||||
"Cy",
|
||||
"Dai",
|
||||
"Dei",
|
||||
"Di",
|
||||
"Dry",
|
||||
"Drye",
|
||||
"Dwi",
|
||||
"Dye",
|
||||
"Eye",
|
||||
"Fae",
|
||||
"Fi",
|
||||
"Fly",
|
||||
"Frei",
|
||||
"Fry",
|
||||
"Frye",
|
||||
"Fy",
|
||||
"Gae",
|
||||
"Guy",
|
||||
"Hai",
|
||||
"Hi",
|
||||
"High",
|
||||
"Hy",
|
||||
"I",
|
||||
"Iie",
|
||||
"Jai",
|
||||
"Kai",
|
||||
"Kwai",
|
||||
"Lai",
|
||||
"Lie",
|
||||
"Luy",
|
||||
"Ly",
|
||||
"Lye",
|
||||
"Mai",
|
||||
"Mei",
|
||||
"Muy",
|
||||
"My",
|
||||
"Nai",
|
||||
"Ngai",
|
||||
"Nie",
|
||||
"Nigh",
|
||||
"Nye",
|
||||
"Phi",
|
||||
"Pi",
|
||||
"Pie",
|
||||
"Ply",
|
||||
"Pri",
|
||||
"Pry",
|
||||
"Psi",
|
||||
"Pty",
|
||||
"Pye",
|
||||
"Rye",
|
||||
"Sai",
|
||||
"Shy",
|
||||
"Sigh",
|
||||
"Sky",
|
||||
"Slier",
|
||||
"Sly",
|
||||
"Spry",
|
||||
"Spy",
|
||||
"Sty",
|
||||
"Stye",
|
||||
"Sy",
|
||||
"Tae",
|
||||
"Tai",
|
||||
"Thai",
|
||||
"Thei",
|
||||
"Thigh",
|
||||
"Thy",
|
||||
"Tie",
|
||||
"Tri",
|
||||
"Trie",
|
||||
"Try",
|
||||
"Tsai",
|
||||
"Ty",
|
||||
"Tye",
|
||||
"Vi",
|
||||
"Vie",
|
||||
"Wai",
|
||||
"Why",
|
||||
"Wir",
|
||||
"Wry",
|
||||
"Wy",
|
||||
"Wye",
|
||||
"Y",
|
||||
"Alibi",
|
||||
"Alkali",
|
||||
"Amebae",
|
||||
"Amoebae",
|
||||
"Amplify",
|
||||
"Apple",
|
||||
"Aquae",
|
||||
"Beatify",
|
||||
"Beautify",
|
||||
"Butterfly",
|
||||
"Certify",
|
||||
"Clarify",
|
||||
"Codify",
|
||||
"Dandify",
|
||||
"Dignify",
|
||||
"Edify",
|
||||
"Firefly",
|
||||
"Fortify",
|
||||
"Gratify",
|
||||
"Hereby",
|
||||
"Horrify",
|
||||
"Justify",
|
||||
"Lullaby",
|
||||
"Misapply",
|
||||
"Modify",
|
||||
"Mollify",
|
||||
"Mortify",
|
||||
"Multiply",
|
||||
"Mummify",
|
||||
"Mystify",
|
||||
"Notify",
|
||||
"Nullify",
|
||||
"Occupy",
|
||||
"Ossify",
|
||||
"Overbuy",
|
||||
"Overfly",
|
||||
"Overlie",
|
||||
"Pacify",
|
||||
"Petrify",
|
||||
"Prettify",
|
||||
"Purify",
|
||||
"Ramify",
|
||||
"Ratify",
|
||||
"Rectify",
|
||||
"Resupply",
|
||||
"Samurai",
|
||||
"Satisfy",
|
||||
"Semidry",
|
||||
"Specify",
|
||||
"Speechify",
|
||||
"Stimuli",
|
||||
"Stupefy",
|
||||
"Termini",
|
||||
"Terrify",
|
||||
"Testify",
|
||||
"Thereby",
|
||||
"Typify",
|
||||
"Ultrahigh",
|
||||
"Underlie",
|
||||
"Underly",
|
||||
"Unify",
|
||||
"Verify",
|
||||
"Versify",
|
||||
"Vilify",
|
||||
"Vitrify",
|
||||
"Vivify",
|
||||
"Whereby",
|
||||
"Yuppify",
|
||||
"Acidify",
|
||||
"Identify",
|
||||
"Oversupply",
|
||||
"Alai",
|
||||
"Ally",
|
||||
"Altai",
|
||||
"Apply",
|
||||
"Awry",
|
||||
"Banzais",
|
||||
"Barfly",
|
||||
"Belie",
|
||||
"Bely",
|
||||
"Blowfly",
|
||||
"Bonsai",
|
||||
"Brunei",
|
||||
"Chiengmai",
|
||||
"Comply",
|
||||
"Decry",
|
||||
"Defy",
|
||||
"Deify",
|
||||
"Deny",
|
||||
"Descry",
|
||||
"Drachmai",
|
||||
"Dubai",
|
||||
"Dupuy",
|
||||
"Goodbye",
|
||||
"Imply",
|
||||
"July",
|
||||
"Lanai",
|
||||
"Mistry",
|
||||
"Nearby",
|
||||
"Nuclei",
|
||||
"Pupae",
|
||||
"Qua",
|
||||
"Quae",
|
||||
"Rely",
|
||||
"Reply",
|
||||
"Retie",
|
||||
"Retry",
|
||||
"Ripply",
|
||||
"Scurfy",
|
||||
"Shanghai",
|
||||
"Standby",
|
||||
"Supply",
|
||||
"Triply",
|
||||
"Turfy",
|
||||
"Untie",
|
||||
"Versailles",
|
||||
}
|
||||
|
||||
var Numsers = []string{
|
||||
"Millions",
|
||||
"Billions",
|
||||
"Trillions",
|
||||
"Quadrillions",
|
||||
"Quintillions",
|
||||
"Sextillions",
|
||||
"Septillions",
|
||||
"Octillions",
|
||||
"Nonillions",
|
||||
"Decillions",
|
||||
"Undecillions",
|
||||
"Duodecillions",
|
||||
"Tredecillions",
|
||||
"Quatttuor-decillions",
|
||||
"Quindecillions",
|
||||
"Sexdecillions",
|
||||
"Septen-decillions",
|
||||
"Octodecillions",
|
||||
"Novemdecillions",
|
||||
"Vigintillions",
|
||||
"Centillions",
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"git.freecumextremist.com/grumbulon/millionsmustbot/internal"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if opts, err := run(os.Args); err != nil {
|
||||
if errors.Is(err, ErrNotError) || strings.Contains(err.Error(), "help requested") {
|
||||
os.Exit(0)
|
||||
} else {
|
||||
opts.Init = false
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func run(args []string) (opts *internal.Options, err error) {
|
||||
opts, err = internal.ParseCLI(args, "DEV")
|
||||
if err != nil {
|
||||
return opts, fmt.Errorf("parse: %w", err)
|
||||
}
|
||||
cfg, err := internal.GetAuthStuff()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
internal.Post(*cfg)
|
||||
return opts, err
|
||||
}
|
||||
|
||||
var ErrNotError = errors.New("not an error")
|
Loading…
Reference in New Issue