b0c69ff chore: we don't need to save coverage
~komidore64 pushed to ~komidore64/lib_discord git
Unfancy Ruby-bindings to interact with Discord's HTTPS web API.
project -- sources -- mailing lists -- bug tracker
lib_discord
requires an installed Ruby runtime
>= 3.2
.
Install the gem and add to your application's Gemfile by executing:
bundle add lib_discord
If bundler is not being used to manage dependencies, install the gem by executing:
gem install lib_discord
require "lib_discord"
client = LibDiscord::Client.new("Bot my.amazing.bot.token")
Access different resource types with #[]
syntax:
client.keys
# =>
# ["application",
# "application_command",
# "application_role_connection_metadata",
# "audit_log",
# "auto_moderation",
# "channel",
# "emoji",
# "guild",
# "guild_scheduled_event",
# "guild_template",
# "interaction",
# "invite",
# "poll",
# "stage_instance",
# "sticker",
# "user",
# "voice",
# "webhook"]
client["channel"]
# => #<LibDiscord::Channel: ... >
Use resources to make requests to Discord's API. LibDiscord resources are mapped to the "Resources" described in Discord's developer documentation.
resp = client["guild"].get_guild_channels(guild_id: "12345678901234567890")
resp.code
# => 200
resp.headers
# => Hash of HTTP response headers
resp.body_parsed
# => deserialized JSON body
resp.body_raw
# => raw response body in String form
Please use the mailing lists if you have questions or need assistance.
Bug reports and patch submissions are welcome on SourceHut via the bug tracker and mailing lists, respectively. This project is intended to be a safe and welcoming space for collaboration. All participants are expected to adhere to the code of conduct.
See CONTRIBUTING.md for more details.
See files in the LICENSES/ directory.