Discord-py

Latest version: v0.16.12

Safety actively analyzes 682532 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 9

2.0.4

- Added a utility method `Inviteurl` ([86](https://github.com/meew0/discordrb/issues/86)/[101](https://github.com/meew0/discordrb/pull/101), thanks PoVa)

Bugfixes

- Fix a caching inconsistency where a server's channels and a bot's channels wouldn't be identical. This caused server channels to not update properly ([105](https://github.com/meew0/discordrb/issues/105))
- Setting avatars should now work again on Windows ([96](https://github.com/meew0/discordrb/issues/96))
- Message edit events should no longer be raised with nil authors ([95](https://github.com/meew0/discordrb/issues/95))
- Invites can now be created again ([87](https://github.com/meew0/discordrb/issues/87))
- Voice states are now preserved for chunked members, fixes an issue where a voice channel's users would ignore all voice states that occurred before the call ([103](https://github.com/meew0/discordrb/issues/103))
- Fixed some possible problems with heartbeats not being sent with unstable connections

2.0.3

- All examples now fully use v2 ([92](https://github.com/meew0/discordrb/pull/92), thanks snapcase)
- The message that occurs when a command is missing permission can now be changed or disabled ([94](https://github.com/meew0/discordrb/pull/94), thanks snapcase)
- The log message that occurs when you disconnect from the WebSocket is now more compact ([90](https://github.com/meew0/discordrb/issues/90))
- `Botignored?` now exists to check whether a user is ignored

Bugfixes

- A problem where getting channel history would sometimes cause an exception has been fixed ([88](https://github.com/meew0/discordrb/issues/88))
- `split_message` should now behave correctly in a specific edge case ([85](https://github.com/meew0/discordrb/pull/85), thanks AnhNhan)
- DCA playback should no longer cause an error when playback ends due to a specific reason

2.0.2

- Added `Servertext_channels` and `voice_channels` ([79](https://github.com/meew0/discordrb/issues/79))
- Added `Serveronline_users` ([80](https://github.com/meew0/discordrb/issues/80))
- Added `Memberrole?` ([83](https://github.com/meew0/discordrb/issues/83))
- Added three utility methods `Useronline?`, `offline?`, and `idle?`
- `Botsend_message` can now take channel objects as well as the ID

Bugfixes

- Removing the bot from a server will no longer result in a gateway message error
- Fixed an exception raised if a previously unavailable guild goes online after the stream timeout
- `server_create` will no longer be raised for newly available guilds
- Fixed the annoying message about constant reassignment at startup
- Fixed an error where rarely a server's owner wouldn't be initialized correctly

2.0.1

- Added some more examples ([75](https://github.com/meew0/discordrb/pull/75), thanks greenbigfrog)
- Users can now be ignored from messages at gateway level (`Botignore_user`, `Botunignore_user`)
- `Memberadd_role` and `Memberremove_role` were re-added from User - they were missing before

Bugfixes

- Fixed some typos in the documentation
- If a server is actually unavailable it will no longer spam the console with timeout messages
- VoiceBot now sends five frames of silence after finishing a track. This fixes an issue where the sound from the last track would bleed over into the new one due to interpolation.
- Fixed a bug where playing something right after connecting to voice would sometimes cause the encryption key to not be set

2.0.0

This is the first major update with some breaking changes! Those are highlighted in bold with migration advice after them. Ask in the Discord channel (see the README) if you have questions.

- **Bot initializers now only use named parameters.** This shouldn't be a hard change to adjust to, but everyone will have to do it. Here's some examples:
rb
Previously
bot = Discordrb::Bot.new 'emailexample.com', 'hunter2', true

Now
bot = Discordrb::Bot.new email: 'emailexample.com', password: 'hunter2', log_mode: :debug

rb
Previously
bot = Discordrb::Bot.new :token, 'TOKEN HERE'

Now
bot = Discordrb::Bot.new token: 'TOKEN HERE', application_id: 163456789123456789

rb
Previously
bot = Discordrb::Commands::CommandBot.new :token, 'TOKEN HERE', '!', nil, {advanced_functionality: false}

Now
bot = Discordrb::Commands::CommandBot.new token: 'TOKEN HERE', application_id: 163456789123456789, prefix: '!', advanced_functionality: false

- Connecting to multiple voice channels at once (only available with bot accounts) is now supported. **This means `bot.voice` now takes the server ID as the parameter**. For a seamless switch, the utility method `MessageEventvoice` was added - simply replace `bot.voice` with `event.voice` in all instances.
- **The `Member` and `Recipient` classes were split off from `User`**. Members are users on servers and recipients are partners in private messages. Since both are delegates to `User`, most things will work as before, but most notably roles were changed to no longer be by ID (for example, instead of `event.author.roles(event.server.id)`, you'd just use `event.author.roles` instead).
- **All previously deprecated methods were removed.** This includes:
- `Serverafk_channel_id=` (use `afk_channel=`, it works with the ID too)
- `Channelis_private` (use `private?` instead, it's more reliable with edge cases like Twitch subscriber-only channels)
- `Botfind` (use `find_channel` instead, it does the exact same thing without confusion with `find_user`)
- **`Server` is now used instead of `Guild` in all external methods and classes.** Previously, all the events regarding roles and such were called `GuildRoleXYZEvent`, now they're all called `ServerRoleXYZEvent` for consistency with other attributes and methods.
- **`advanced_functionality` is now disabled by default.** If you absolutely need it, you can easily re-enable it by just setting that parameter in the CommandBot initializer, but for most people that didn't need it this will fix some bugs with mentions in commands and such.
- **`Userbot?` was renamed to `Usercurrent_bot?`** with the addition of the `Userbot_account?` reader to check for bot account-ness (the "BOT" tag visible on Discord)
- Member chunks will no longer automatically be requested on startup, but rather once they're actually needed (`event.server.members`). This is both a performance change (much faster startup for large bots especially) and an important API compliance one - this is what the Discord devs have requested.
- Initial support for bots that have no WebSocket connection was started. This is useful for web apps that need to get information on something without having to run something in the background all the time. A tutorial on these will be coming soon, in the meantime, use this short example:
rb
require 'discordrb'
require 'discordrb/light'

bot = Discordrb::Light::LightBot.new 'token here'
puts bot.profile.username

- OAuth bot accounts are now better supported using a method `Botinvite_url` to get a bot's invite URL and sending tokens using the new `Bot` prefix.
- discordrb now fully uses [websocket-client-simple](https://github.com/shokai/websocket-client-simple) (a.k.a. WSCS) instead of Faye::WebSocket, this means that the annoying OpenSSL library thing won't have to be done anymore.
- The new version of the Discord gateway (v4) is supported and used by default. This should bring more stability and possibly slight performance improvements.
- Some older v3 features that weren't supported before are now:
- Compressed ready packets (should decrease network overhead for very large bots)
- Discord rate limits are now supported better - the client will never send a message if it knows it's going to be rate limited, instead it's going to wait for the correct time.
- Requests will now automatically be retried if a 502 (cloudflare error) is received.
- `MessageEditEvent`s now have a whole message instead of just the ID to allow for checking the content of edited messages.
- `Message`s now have an `attachments` array with files attached to the message.
- `ReadyEvent` and `DisconnectEvent` now have the bot as a readable attribute - useful for container-based bots that don't have a way to get them otherwise.
- `Botfind_channel` can now parse channel mentions and search for specific types of channels (text or voice).
- `Servercreate_channel` can now create voice channels.
- A utility function `Userdistinct` was added to get the distinct representation of a user (i.e. name + discrim, for example "meew09811")
- The `Userdiscriminator` attribute now has more aliases (`tag`, `discord_tag`, `discrim`)
- `Permission` objects can now be created or set even without a role writer, useful to quickly get byte representations of permissions
- Permission overwrites can now be defined more easily using the utility method `Channeldefine_overwrite`
- `Message`s returned at the end of commands (for example using `Userpm` or `Messageedit`) will now no longer be sent ([66](https://github.com/meew0/discordrb/issues/66))
- The `:with_text` event attribute is now aliased to `:exact_text` ([65](https://github.com/meew0/discordrb/issues/65))
- Server icons (`Servericon=`) can now be set just like avatars (`Profileavatar=`)
- Lots of comments were added to the examples and some bugs fixed
- The overall performance and memory usage was improved, especially on Ruby 2.3 (using the new frozen string literal comment)
- The documentation was slightly improved.

**Bugfixes**:
- A *lot* of latent bugs with caching were fixed. This doesn't really have a noticeable effect, it just means better stability and reliability as a whole.
- **Command bots no longer respond when there are spaces between the prefix and the command.** Because this behaviour may be desirable, a `spaces_allowed` attribute was added to the CommandBot initializer that can be set to true to re-enable this behaviour.
- Permission calculation (`Userpermission?`) has been thoroughly rewritten and should now account for edge cases like server owners and Manage Permissions.
- The gateway reconnect logic now uses a correct falloff system - before it would start at 1 second between attempts and immediately jump to 120. Now the transition is more smooth.
- Commands with aliases now show up correctly in the auto-generated help command ([72](https://github.com/meew0/discordrb/issues/72))
- The auto-generated help command can now actually be disabled by setting the corresponding attribute to nil ([73](https://github.com/meew0/discordrb/issues/73))
- Including empty containers now does nothing instead of raising an error
- Command bots now obey `should_parse_self`

1.8.1

Bugfixes
* Fixed an error (caused by an undocumented API change) that would write a traceback to the console every time someone started typing in a channel invisible to the bot.

Page 3 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.