discrod
Version, currently master branch1 version
- master branchlatestMay 8, 2020
github.com/voximity/discrod
Experimental Discord library for Crystal
Installation
# Add this to your shard.yml
dependencies:
discrod:
github: voximity/discrod
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.34.0- License
- MIT
- Author
- voximity
Dependencies
Runtime Dependencies
- emoji*github: veelenga/emoji.cr, branch: master
README
discrod
discrod is an experimental Discord library for Crystal. I am writing this to serve as a replacement for one of my bot projects' current implementation in C#.
If you are looking for a production-ready Discord library, check out discordcr. This library is not ready for full use.
Installation
Add this to your application's shard.yml:
dependencies:
discrod:
github: voximity/discrod
Usage
require "discrod"
client = Discrod::Client.new token: "my-token", token_type: Discrod::TokenType::Bot
client.on_message_create do |message|
if message.content == "ping"
builder = Discrod::EmbedBuilder.new do |e|
e.with_title "Pong!"
e.with_description "discrod speaking!"
e.with_current_time
e.with_author(message.author)
end
message.react Discrod::Emoji.new ":confetti_ball:"
message.channel.create_message embed: builder.build
end
end
client.connect
All endpoints are available in Client as low-level API calls with very little abstraction between.
For higher-level API calls, each resource has their appropriate methods to help mitigate Client usage.
For example, Message#delete is synonymous with Client#delete_message(channel_id, message_id).
Caches
By default, resource caching is enabled. You can assign a cache to periodically wipe:
client.guild_cache!.clear_periodic 1.hours
Contributing
- Fork it (https://github.com/voximity/discrod/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- May 8, 2020
- Crystal
0.34.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/voximity/discrod
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 17, 2026
- Synced
- Aug 17, 2026
- Versions
- 1