Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
github.com/SevereCloud/vksdk
VK SDK for Golang готовая реализация основных функций VK API для языка Go.
# go mod init mymodulename
go get github.com/SevereCloud/vksdk@latest
package main
import (
"log"
"github.com/SevereCloud/vksdk/api"
"github.com/SevereCloud/vksdk/api/params"
"github.com/SevereCloud/vksdk/longpoll-bot"
"github.com/SevereCloud/vksdk/object"
)
func main() {
token := "<TOKEN>" // рекомендуется использовать os.Getenv("TOKEN")
vk := api.NewVK(token)
// Получаем информацию о группе
group, err := vk.GroupsGetByID(api.Params{})
if err != nil {
log.Fatal(err)
}
// Инициализируем longpoll
lp, err := longpoll.NewLongpoll(vk, group[0].ID)
if err != nil {
log.Fatal(err)
}
// Событие нового сообщения
lp.MessageNew(func(obj object.MessageNewObject, groupID int) {
log.Printf("%d: %s", obj.Message.PeerID, obj.Message.Text)
if obj.Message.Text == "ping" {
b := params.NewMessagesSendBuilder()
b.Message("pong")
b.RandomID(0)
b.PeerID(obj.Message.PeerID)
_, err := vk.MessagesSend(b.Params)
if err != nil {
log.Fatal(err)
}
}
})
// Запускаем Bots Longpoll
log.Println("Start longpoll")
if err := lp.Run(); err != nil {
log.Fatal(err)
}
}
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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.