Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lib_discord

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lib_discord

  • 0.1.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

lib_discord

Unfancy Ruby-bindings to interact with Discord's HTTPS/REST web API.

project -- sources -- mailing lists -- bug tracker

builds.sr.ht status Gem Version

Installation

lib_discord requires an installed Ruby runtime >= 3.2.

Install the gem and add to the 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

Usage

require "lib_discord"
client = LibDiscord::Client.new("Bot my.amazing.bot.token")

Access 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["application"]
# => #<LibDiscord::Application: ... >

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
# => JSON body deserialized to a Hash

resp.body_raw
# => raw response body in String form

Getting help

Please use the mailing lists if you have questions or need help.

Contributing

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, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Code style

This project adheres to Standard Ruby style rules.

Additionally, we strive for an 80 character line length, but it's not a hard-and-fast rule. There are occasions where breaking an expression across multiple lines decreases readability for no benefit other than to appease a linter. As such, there is no tool to enforce an 80 character line length.

Code of Conduct

Everyone interacting in the lib_discord project's codebase, bug trackers, chat rooms, and mailing lists is expected to follow the code of conduct.

Licenses

See files in the LICENSES directory.

FAQs

Package last updated on 26 Jul 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc