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/tscs37/d.g
discord.go is a wrapper for bwmarrin/discordgo to enable a few "oh that's neat" functions.
d.g is heavily context-based and focues on bot development.
The goal is that all functionality a bot might need is provided out of the box and can be used without having to think about the discord API.
A bot is easily created with d.g
Here is an example:
package main
import ddg "go.rls.moe/d.g"
func main() {
bot, err := ddg.NewBot("<your token>")
if err != nil {
println(err)
return
}
bot.SetSink(ddg.NewSimpleMessageHandler(handler))
bot.BlockForExit()
}
func handler(c ddg.Context, ch *ddg.Channel, m *ddg.Message) error {
if m.FromMe() {
return nil
}
if m.DisplayText() == "ping" {
m.Respond("pong")
}
if m.DisplayText() == "exit" {
c.RequestExit()
}
return nil
}
Refer to the godoc documentation for further information.
(The Documentation is still being worked on, the library is still under development)
This library aims to completely wrap discordgo.
The first step is to wrap some read-only functionality and some basic response methods to allow bots interacting with the chat.
The second step is to implement all management methods so that easy functions exist to assign roles, ban users or create channels.
The application using this library should not have to come in contact with any discordgo types but the library should also provide access to the underlying session so they can use the original discordgo package if needed.
Please file issues if you find a bug or have a feature request.
At the moment this project lacks basic tests, which hopefully can be added at some point, but they are not a priority, pull requests for them are welcome however.
This repository originates on git.timschuster.info/tscs37/discord.go
There is a code mirror on Github
To go-get the code use go.rls.moe/d.g.
To the GopherPit project for providing a go-gettable vanity service.
To bwmarrin for writting an excellent Discord API.
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.