removes unimplemented packages
This commit is contained in:
parent
5d96c929bb
commit
4dfeebf561
2 changed files with 0 additions and 105 deletions
|
@ -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("")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
Loading…
Reference in a new issue