![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
This is a Ruby library for the Discord HTTP API. Currently in development
Add this line to your application's Gemfile:
gem "discord_api"
Firstly you'll need to set either a user token or bot token. Some endpoints are only accssible with a bot token.
# Set a user token
@client = Discord::Client.new(user_access_token: "")
# Or set a bot token
@client = Discord::Client.new(bot_access_token: "")
# Get the current user
# Required scope: identify
# Required scopes if you want the user's email: identify email
@client.users.me
# Get the user's guilds
# Required scope: guilds
@client.users.guilds
These endpoints are only accessible using a bot token.
# Retrieve a Channel
@client.channels.retrieve(id: 123123)
# Update a Channel's details
# https://discord.com/developers/docs/resources/channel#modify-channel
@client.channels.update(id: 123123, name: "new-channel-name")
These endpoints are only accessible using a bot token.
# List messages for a channel
@client.messages.list(channel_id: 123123)
# Get a message
@client.messages.retrieve(channel_id: 123123, message_id: 123123)
# Create a message
# https://discord.com/developers/docs/resources/channel#create-message
@client.messages.create(channel_id: 123123, content: "Hello World")
# Update a message
# https://discord.com/developers/docs/resources/channel#edit-message
@client.messages.update(channel_id: 123123, message_id: 123123, content: "Hello World")
# Delete a message
@client.messages.delete(channel_id: 123123, message_id: 123123)
# Bulk delete messages
@client.messages.bulk_delete(channel_id: 123123, ids: [123123, 321321])
These endpoints are only accessible using a bot token.
# Retrieve a Guild's details
@client.guilds.retrieve(id: 123123)
# Update a Guild's details
# https://discord.com/developers/docs/resources/guild#modify-guild
@client.guilds.update(id: 123123, name: "new-guild-name")
# Retrieve a list of a Guild's channels
@client.guilds.channels(guild: 123123)
# Create a Guild channel
# https://discord.com/developers/docs/resources/guild#create-guild-channel
@client.guilds.create_channel(guild: 123123, name: "new-channel-name")
Bug reports and pull requests are welcome on GitHub at https://github.com/deanpcmad/discord_api.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that discord_api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.