diff --git a/cmd/groupbot/main.go b/cmd/groupbot/main.go deleted file mode 100644 index 81956a6..0000000 --- a/cmd/groupbot/main.go +++ /dev/null @@ -1,98 +0,0 @@ -package main - -import ( - "context" - "fmt" - "github.com/disgoorg/disgo" - "github.com/disgoorg/disgo/bot" - "github.com/disgoorg/disgo/cache" - "github.com/disgoorg/disgo/gateway" - "github.com/disgoorg/log" - "github.com/disgoorg/snowflake/v2" - "os" -) - -var ( - token = os.Getenv("disgo_token") - registerGuildID = snowflake.GetEnv("disgo_guild_id") -) - -func main() { - - log.SetLevel(log.LevelDebug) - log.Info("starting groupbot...") - log.Info("disgo version: ", disgo.Version) - - // permissions: - // intent: - client, err := disgo.New(token, - bot.WithGatewayConfigOpts( - gateway.WithIntents(gateway.IntentsNone), - ), - bot.WithCacheConfigOpts( - cache.WithCaches( - cache.FlagsNone, - ), - ), - ) - if err != nil { - log.Fatal("error while building disgo instance: ", err) - return - } - defer client.Close(context.TODO()) - - var groups Groups - for i := 0; i < 30; i++ { - groups = append(groups, Group{ - name: fmt.Sprintf("g%v", i), - group: "", - emoji: "", - }) - } - createGroupMessage(groups) - - if err = client.OpenGateway(context.TODO()); err != nil { - log.Fatal("error while connecting to gateway: ", err) - } - - log.Infof("groupbot is now running. Press CTRL-C to exit.") - //s := make(chan os.Signal, 1) - //signal.Notify(s, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) - //<-s -} - -type Group struct { - name string - group string - emoji string -} - -type Groups []Group - -// chunk -// source https://github.com/golang/go/issues/53987 -func chunk[T any](arrIn []T, size int) (arrOut [][]T) { - for i := 0; i < len(arrIn); i += size { - end := i + size - if end > len(arrIn) { - end = len(arrIn) - } - arrOut = append(arrOut, arrIn[i:end]) - } - return arrOut -} - -func createGroupMessage(groups Groups) { - groupsMessages := chunk(chunk(groups, 5), 5) - - for _, messageGroups := range groupsMessages { - fmt.Println("--- new message ---") - for _, rowGroups := range messageGroups { - fmt.Printf("new row: ") - for _, group := range rowGroups { - fmt.Printf("%v;", group.name) - } - fmt.Println("") - } - } -} diff --git a/cmd/msgbot/main.go b/cmd/msgbot/main.go deleted file mode 100644 index 1d92a76..0000000 --- a/cmd/msgbot/main.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -func main() { - // command to send admin messages (for example https://discord.com/channels/425773377349877769/704611918089814076/936598872636129380) - // as embed or just message - // possibility to edit -}