Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metagn-archives/discordg
Very old Groovy wrapper for Discord API
https://github.com/metagn-archives/discordg
discord discord-bot dsl groovy
Last synced: 7 days ago
JSON representation
Very old Groovy wrapper for Discord API
- Host: GitHub
- URL: https://github.com/metagn-archives/discordg
- Owner: metagn-archives
- Created: 2016-01-02T05:20:47.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-01-18T15:40:45.000Z (about 1 year ago)
- Last Synced: 2024-12-02T12:18:24.735Z (2 months ago)
- Topics: discord, discord-bot, dsl, groovy
- Language: Groovy
- Homepage:
- Size: 1.22 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DiscordG
Really old (most development in 2016) wrapper for the Discord bot API in Groovy.
Code might not be the cleanest and some variable names are not pretty because I was
13 when I wrote most of this (a lot of commit names have been scrubbed for the same reason).
Consider using (not sure which of these are active anymore):[JDA](https://github.com/DV8FromTheWorld/JDA)
[Discord4J](https://github.com/austinv11/Discord4J)
[Javacord](https://github.com/BtoBastian/Javacord)
Features, good or bad:
* No event enum or classes, so doesn't crash when Discord's API adds a new event.
* Raw websocket json listener
* Channel/message types are ints, but constants and helper methods exist.
* Permissions are handled
* No async. Threadpool for websocket events.
* No voice
* No embed DSL, you just use maps. So even JsonBuilder would work.
* Pretty much no features after audit logs, except intents
* Used to have a status package which supported the status.discordapp.com api.
* Small binary size (?) considering.
* DSL, see examples/dsl
* CommandBot, see examples/bot
* @CompileStatic pretty much everywhere, so as fast as regular Java
* `guild.member()`, `client.channel()` methods only work on names or IDs```groovy
// discordg:
role.edit(name: "New role name", color: 0xFF00FF)// discord4j:
role.edit(new Color(0xFF00FF), role.hoisted, "New role name", role.permissions, role.mentionable)// jda:
role.managerUpdatable.nameField.setValue("New role name").colorField.setValue(new Color(0xFF00FF)).update().queue()
// alternatively
role.managerUpdatable.with {
nameField.value = "New role name"
colorField.value = new Color(0xFF00FF)
}.update().queue()// javacord:
role.with {
updateName "New role name" get()
updateColor new Color(0xFF00FF) get()
}
// or same as discord4j except the edit method is called update
``````groovy
def client = new Client()def webhook = [webhook: true, id: 300000000000, token: "300000"]
client.sendMessage(webhook, "Hello")def webhook = new Webhook(client)
webhook.id = 300000000000
webhook.token = "300000"
webhook.sendMessage("Hello")def webhook = client.requestWebhook(300000000000, "300000")
```