Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
An implementation of the Discord API using Ruby.
See also: Documentation, Tutorials
discordrb
aims to meet the following design goals:
If you enjoy using the library, consider getting involved with the community to help us improve and meet these goals!
You should consider using discordrb
if:
You should consider other libraries if:
This section only applies to you if you want to use voice functionality.
Using Bundler, you can add discordrb to your Gemfile:
gem 'discordrb'
And then install via bundle install
.
Run the ping example to verify that the installation works (make sure to replace the token and client ID in there with your bots'!):
To run the bot while using bundler:
bundle exec ruby ping.rb
Alternatively, while Bundler is the recommended option, you can also install discordrb without it.
gem install discordrb
Make sure you have the DevKit installed! See the Dependencies section)
gem install discordrb --platform=ruby
To run the bot:
ruby ping.rb
See https://github.com/shardlab/discordrb/wiki/FAQ#installation for a list of common problems and solutions when installing discordrb
.
You can make a simple bot like this:
require 'discordrb'
bot = Discordrb::Bot.new token: '<token here>'
bot.message(with_text: 'Ping!') do |event|
event.respond 'Pong!'
end
bot.run
This bot responds to every "Ping!" with a "Pong!".
You can find examples of projects that use discordrb by searching for the discordrb topic on GitHub.
If you've made an open source project on GitHub that uses discordrb, consider adding the discordrb
topic to your repo!
Also included is a webhooks client, which can be used as a separate gem discordrb-webhooks
. This special client can be used to form requests to Discord webhook URLs in a high-level manner.
discordrb-webhooks
documentationrequire 'discordrb/webhooks'
WEBHOOK_URL = 'https://discord.com/api/webhooks/424070213278105610/yByxDncRvHi02mhKQheviQI2erKkfRRwFcEp0MMBfib1ds6ZHN13xhPZNS2-fJo_ApSw'.freeze
client = Discordrb::Webhooks::Client.new(url: WEBHOOK_URL)
client.execute do |builder|
builder.content = 'Hello world!'
builder.add_embed do |embed|
embed.title = 'Embed title'
embed.description = 'Embed description'
embed.timestamp = Time.now
end
end
Note: The discordrb
gem relies on discordrb-webhooks
. If you already have discordrb
installed, require 'discordrb/webhooks'
will include all of the Webhooks
features as well.
If you need help or have a question, you can:
Thank you for your interest in contributing! Bug reports and pull requests are welcome on GitHub at https://github.com/shardlab/discordrb.
In general, we recommend starting by discussing what you would like to contribute in the Discord channel. There are usually a handful of people working on things for the library, and what you're looking for may already be on the way.
Additionally, there is a chance what you are looking for might already exist, or we decided not to pursue it for some reason. Be sure to use the search feature on our documentation, GitHub, and Discord to see if this might be the case.
This section is for developing discordrb itself! If you just want to make a bot, see the Installation section.
After checking out the repo, run bin/setup
to install dependencies. You can then run tests via bundle exec rspec spec
. Make sure to run rubocop also: bundle exec rubocop
. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that discordrb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.