
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
github.com/topisenpai/dgo-paginator
dgo-paginator is a paginator working with buttons. It can be used with interactions and normal messages.
go get github.com/topi314/dgo-paginator
// create new dgo session
dg, err := discordgo.New("Bot " + token)
// create a new pagination manager
manager := paginator.NewManager()
// register the pagination handler
dg.AddHandler(manager.OnInteractionCreate)
// add a message create handler to spawn a paginator
dg.AddHandler(func(s *discordgo.Session, m *discordgo.MessageCreate) {
if m.Author.ID == s.State.User.ID || m.Content != "!test" {
return
}
// your pages can be anything
pages := []string{
"page1",
"page2",
"page3",
}
err := manager.CreateMessage(s, m.ChannelID, &paginator.Paginator{
// the PageFunc is called when a new page is requested put your data per page in here
PageFunc: func(page int, embed *discordgo.MessageEmbed) {
embed.Description = pages[page]
},
// the max pages this paginator has
MaxPages: len(pages),
// expire after last usage or when created?
ExpiryLastUsage: true,
})
if err != nil {
fmt.Println(err)
}
})
// open the session
if err = dg.Open(); err != nil {
fmt.Println("error opening connection: ", err)
return
}
// keep the session open
s := make(chan os.Signal, 1)
signal.Notify(s, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
<-s
Create a new collector by passing it the discordgo.Session
& a filter function.
The filter function will be called for every event.
If the filter function returns true, the event will be collected and passed through the channel.
If the filter function returns false, the event will be ignored.
If you are done collecting don't forget to close the collector.
eventChannel, stopCollector := event_collector.NewEventCollector(ssession, func(s *discordgo.Session, e *discordgo.MessageCreate) bool {
return // filter your events here
})
You can find examples under _examples
Contributions are welcomed but for bigger changes please create a discussion.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.