Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/harryet/shimmer
A Gleam library for interacting with the Discord API
https://github.com/harryet/shimmer
beam discord discord-api gleam
Last synced: about 2 months ago
JSON representation
A Gleam library for interacting with the Discord API
- Host: GitHub
- URL: https://github.com/harryet/shimmer
- Owner: HarryET
- License: apache-2.0
- Created: 2022-01-08T13:34:47.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-11T12:53:57.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T23:51:36.405Z (about 2 months ago)
- Topics: beam, discord, discord-api, gleam
- Language: Gleam
- Homepage:
- Size: 163 KB
- Stars: 35
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Shimmer
A Gleam library for interacting with the Discord API
> **Warning**
> This Library is pre-alpha and being worked on.## Talks
- [FOSDEM 2023](https://fosdem.org/2023/schedule/event/beam_gleam_intro/) ([Harry Bairstow](https://github.com/HarryET))## Basic Example
```
shimmer = "~> 0.0.6"
gleam_stdlib = "~> 0.25"
gleam_erlang = "~> 0.17"
``````gleam
import gleam/io
import gleam/string
import gleam/int
import gleam/erlang/process
import shimmer
import shimmer/handlerspub fn main() {
let handlers =
handlers.new_builder()
|> handlers.on_ready(fn(data, _client) {
io.println(
[
"Logged in as ",
data.user.username,
" (",
int.to_string(data.user.id),
")",
]
|> string.join(with: ""),
)
})
|> handlers.on_message(fn(message, _client) { io.print("Received: " <> message) })let client =
shimmer.new("TOKEN")
|> shimmer.connect(handlers)process.sleep_forever()
}
```## Supported Events
- [x] Ready
- [ ] Resumed
- [ ] Channel Create
- [ ] Channel Update
- [ ] Channel Delete
- [ ] Channel Pins Update
- [ ] Guild Create
- [ ] Guild Update
- [ ] Guild Delete
- [ ] Guild Ban Add
- [ ] Guild Ban Remove
- [ ] Guild Emoji Update
- [ ] Guild Integrations Update
- [ ] Guild Member Add
- [ ] Guild Member Remove
- [ ] Guild Member Update
- [ ] Guild Members Chunk
- [ ] Guild Role Create
- [ ] Guild Role Update
- [ ] Guild Role Delete
- [ ] Invite Create
- [ ] Invite Delete
- [x] Message Create
- [ ] Message Update
- [ ] Message Delete
- [ ] Message Delete Bulk
- [ ] Message Reaction Add
- [ ] Message Reaction Remove
- [ ] Message Reaction Remove All
- [ ] Message Reaction Remove Emoji
- [ ] Presence Update
- [ ] Typing Start
- [ ] User Update
- [ ] Voice State Update
- [ ] Voice Server Update
- [ ] Webhooks Update