Bot releases are visible (Hide)
This update isn't just another runway hop; it's a potential moon mission for bot functionality. Expect smoother performance than a high-end sports car on a freshly paved racetrack, and features so innovative they'll make even the most jaded bot user do a happy dance. Alchemists, you have my assurance that with Nostrum 0.9.0, "return to flight" isn't just a codename, it's a promise of soaring possibilities.
After a 324 day hiatus since the release of Nostrum 0.8.0, the new latest release ships with new features, performance improvements and much more, all of which are broken down below.
A full changelog of the changes since v0.8.0 and v0.9.0 can be found here.
{:error, {:connection_died, reason}}
:sys.trace(Nostrum.Api.Ratelimiter, true)
.GuildCache.all/0
GuildCache.select_by/1
GuildCache.select/2
along GuildCache.select!/2
Nostrum.Cache.ChannelCache
module (see #555 for details).appup
file to allow upgrading it in environments.appup
files.use Nostrum.Consumer
manages this now.Util.get_all_shard_latencies
is fixed by @Th3-M4jor in #507To my new cats, Benjamin and Olive, Daddy loves you
-- Craig
(Premptively) in loving memory of Jeremiah Boby
-- Johannes
To my many loving fans in the Discord API #general channel
-- Joe
Published by jb3 6 months ago
Welcome to the release candidate for Nostrum 0.9, code-named "Return to Flight".
NOTE: There is not an appup instruction for this release, there will be for Nostrum 0.9.
Nostrum.Cache.ChannelCache
module (see #555 for details)Util.get_all_shard_latencies
is fixed by @Th3-M4jor in #507Full Changelog: https://github.com/Kraigie/nostrum/compare/v0.9.0-alpha2...v0.9.0-rc1
Published by jchristgit over 1 year ago
Welcome to nostrum 0.9.0, codenamed "T - 5".
The following functions, deprecated in nostrum 0.8, have been removed:
GuildCache.all/0
GuildCache.select_by/1
GuildCache.select/2
along with GuildCache.select!/2
.appup
file to allow upgrading it in environments{:error, {:connection_died, reason}}
:sys.trace(Nostrum.Api.Ratelimiter, true)
..appup
files.use Nostrum.Consumer
manages this now.Published by jchristgit over 1 year ago
nostrum 0.9.0-alpha1
Welcome to nostrum 0.9.0, codenamed "T - 5".
The following functions, deprecated in nostrum 0.8, have bene removed:
GuildCache.all/0
GuildCache.select_by/1
GuildCache.select/2
.appup
file to allow upgrading it in environments{:error, {:connection_died, reason}}
:sys.trace(Nostrum.Api.Ratelimiter, true)
..appup
files.Published by jchristgit over 1 year ago
Welcome to nostrum 0.8.0, codenamed "ignition on".
This release introduces full support for distributed caching and state, and
simplifies the existing cache behaviours by using a single shared interface for
reading the cache using Erlang's QLC module. Simply put, instead of having to
implement callbacks for every combination of functions that nostrum exposes (and
will expose) to the cache, a pluggable cache only needs to implement the
c:query_handle/0
callback. To fulfill this move, a few smaller breaking
changes have been performed. It is expected that these will be the last bigger
breaking changes done before the proper 1.0 release (at which point we will
follow semantic versioning).
Note that cache distribution was not the only missing piece to allow
distributing nostrum across multiple nodes (albeit the largest one). Gateway
event handling must be updated to prevent duplicate gateway connections,
proper distribution of shards over nodes must be implemented, and some other
improvements in regards to gateway connections with many shards must be
implemented, including support for persistent resume seq tokens.
MemberCache
have beenMemberCache.get/1
-> MemberCache.fold/3-4
MemberCache.get_with_users/1
-> MemberCache.fold_with_users/3-4
MemberCache.by_user/1
-> MemberCache.fold_by_user/3-4
safe_fixtable
:mnesia.activity
.:channel_not_found
-> :not_found
:presence_not_found
-> :not_found
:id_not_found
-> :not_found
:id_not_found_on_guild_lookup
-> :not_found
:channel_not_found
-> :not_found
ChannelCache
will no longer look up channels in the GuildCache
if theyGuildCache
if needed.PresenceCache.get(user_id, guild_id)
is now PresenceCache.get(guild_id, user_id)
, the same for PresenceCache.get!/2
.
The following functions have been deprecated and will be removed in either
nostrum 0.9 or 1.0:
GuildCache.all/0
GuildCache.select_by/1
GuildCache.select/2
guild_id
field:find_by(RequestedGuildId, Name, Discriminator, MemberCache, UserCache) ->
qlc:q([Member || {{GuildId, MemberId}, Member} <- MemberCache:query_handle(),
GuildId =:= RequestedGuildId,
{UserId, User} <- UserCache:query_handle(),
MemberId =:= UserId,
map_get(username, User) =:= Name,
map_get(discriminator, User) =:= Discriminator]).
{lowest, highest, total}
, where nostrum will start lowest..highest
total
shards in total.Nostrum.Cache
modules now have an Mnesia-based cache adapter thatchild_spec
is sufficient.retry_after
was 0.Nostrum.Consumer
moduledoc.Published by jchristgit over 1 year ago
nostrum 0.8.0-beta1
Welcome to nostrum 0.8.0, codenamed "ignition on".
This release introduces full support for distributed caching and state, and
simplifies the existing cache behaviours by using a single shared interface for
reading the cache using Erlang's QLC module. Simply put, instead of having to
implement callbacks for every combination of functions that nostrum exposes (and
will expose) to the cache, a pluggable cache only needs to implement the
c:query_handle/0
callback. To fulfill this move, a few smaller breaking
changes have been performed. It is expected that these will be the last bigger
breaking changes done before the proper 1.0 release (at which point we will
follow semantic versioning).
Note that cache distribution was not the only missing piece to allow
distributing nostrum across multiple nodes (albeit the largest one). Gateway
event handling must be updated to prevent duplicate gateway connections,
proper distribution of shards over nodes must be implemented, and some other
improvements in regards to gateway connections with many shards must be
implemented, including support for persistent resume seq tokens.
MemberCache
have beenMemberCache.get/1
-> MemberCache.fold/3-4
MemberCache.get_with_users/1
-> MemberCache.fold_with_users/3-4
MemberCache.by_user/1
-> MemberCache.fold_by_user/3-4
safe_fixtable
:mnesia.activity
.:channel_not_found
-> :not_found
:presence_not_found
-> :not_found
:id_not_found
-> :not_found
:id_not_found_on_guild_lookup
-> :not_found
:channel_not_found
-> :not_found
ChannelCache
will no longer look up channels in the GuildCache
if theyGuildCache
if needed.PresenceCache.get(user_id, guild_id)
is now PresenceCache.get(guild_id, user_id)
, the same for PresenceCache.get!/2
.
The following functions have been deprecated and will be removed in either
nostrum 0.9 or 1.0:
GuildCache.all/0
GuildCache.select_by/1
GuildCache.select/2
guild_id
field:find_by(RequestedGuildId, Name, Discriminator, MemberCache, UserCache) ->
qlc:q([Member || {{GuildId, MemberId}, Member} <- MemberCache:query_handle(),
GuildId =:= RequestedGuildId,
{UserId, User} <- UserCache:query_handle(),
MemberId =:= UserId,
map_get(username, User) =:= Name,
map_get(discriminator, User) =:= Discriminator]).
{lowest, highest, total}
, where nostrum will start lowest..highest
total
shards in total.Nostrum.Cache
modules now have an Mnesia-based cache adapter thatchild_spec
is sufficient.retry_after
was 0.Nostrum.Consumer
moduledoc.Published by jchristgit over 1 year ago
nostrum 0.8.0-alpha1
Welcome to nostrum 0.8.0, codenamed "ignition on".
This release introduces full support for distributed caching and state, and
simplifies the existing cache behaviours by using a single shared interface for
reading the cache using Erlang's QLC module. Simply put, instead of having to
implement callbacks for every combination of functions that nostrum exposes (and
will expose) to the cache, a pluggable cache only needs to implement the
c:query_handle/0
callback. To fulfill this move, a few smaller breaking
changes have been performed. It is expected that these will be the last bigger
breaking changes done before the proper 1.0 release (at which point we will
follow semantic versioning).
Note that cache distribution was not the only missing piece to allow
distributing nostrum across multiple nodes (albeit the largest one). Gateway
event handling must be updated to prevent duplicate gateway connections,
proper distribution of shards over nodes must be implemented, and some other
improvements in regards to gateway connections with many shards must be
implemented, including support for persistent resume seq tokens.
MemberCache
have beenMemberCache.get/1
-> MemberCache.fold/3-4
MemberCache.get_with_users/1
-> MemberCache.fold_with_users/3-4
MemberCache.by_user/1
-> MemberCache.fold_by_user/3-4
safe_fixtable
:mnesia.activity
.:channel_not_found
-> :not_found
:presence_not_found
-> :not_found
:id_not_found
-> :not_found
:id_not_found_on_guild_lookup
-> :not_found
:channel_not_found
-> :not_found
ChannelCache
will no longer look up channels in the GuildCache
if theyGuildCache
if needed.PresenceCache.get(user_id, guild_id)
is now PresenceCache.get(guild_id, user_id)
, the same for PresenceCache.get!/2
.
The following functions have been deprecated and will be removed in either
nostrum 0.9 or 1.0:
GuildCache.all/0
GuildCache.select_by/1
GuildCache.select/2
guild_id
field:find_by(RequestedGuildId, Name, Discriminator, MemberCache, UserCache) ->
qlc:q([Member || {{GuildId, MemberId}, Member} <- MemberCache:query_handle(),
GuildId =:= RequestedGuildId,
{UserId, User} <- UserCache:query_handle(),
MemberId =:= UserId,
map_get(username, User) =:= Name,
map_get(discriminator, User) =:= Discriminator]).
{lowest, highest, total}
, where nostrum will start lowest..highest
total
shards in total.Nostrum.Cache
modules now have an Mnesia-based cache adapter thatchild_spec
is sufficient.retry_after
was 0.Nostrum.Consumer
moduledoc.Published by jchristgit over 1 year ago
Welcome to nostrum 0.7.0, codenamed "launch preparations".
This release brings you support for automod and forum channels, helps you with
navigating through Discord's numbering schemes with the new modules under
Nostrum.Constants
, allows you to retrieve audit log entries over the gateway,
and much more. For the full list of features and bugfixes, see below.
This release contains breaking changes in regards to member caching. If you
want the short version, scroll down to the "Breaking changes" section. This
part will document the changes and their reasoning.
Two main breaking changes have been performed, that are almost guaranteed to
cause breakage on your bot:
Nostrum.Cache.MemberCache
handles caching guild members, andNostrum.Cache.MemberCache.get_with_users/1
, that will:qlc
join between the member and user cache.For the join function to work, the callback c:qlc_handle/0
has been added to
both Nostrum.Cache.MemberCache
and Nostrum.Cache.UserCache
. It is expected
that more functionality will be built on top of :qlc
in the future,
especially as nostrum approaches its 1.0 release, so it's heavily recommended
to add this callback for any custom consumers. The Erlang documentation
explains how to implement a QLC
table for
any custom caches you may have.
Why were these changes done? Nostrum previously struggled when working with
large guilds. With the ETS-based guild cache, updating a member would mean
fetching the entire guild object from the cache, for ETS, this means making a
full copy of the entire struct. While probably unproblematic for most usecases,
running Nostrum with request_guild_members: true
on large guilds would cause
memory usage to skyrocket for a brief period at the start while Nostrum
struggled to gobble all of the users into the cache. Unfortunately, fixing this
was not possible without breaking the API. The :user
field was removed as the
members change will already require changes on your side, and nostrum
previously did not update users on members properly, causing stale data. We
want the caches to work independently from each other, so this seemed the
proper solution. If you want to have some rough idea of how to change it, see
this commit on
bolt.
Due to the new separation and removal of duplicated user data, nostrum is now
lighter on memory. The "Breaking changes" section below contains a complete
listing of these changes. If you use a third-party command library such as
:nosedrum
, you will likely need to upgrade those as well.
For the breaking changes mentioned above, the following should serve as a
guideline to the full list of breaking changes in the section below:
GuildCache.get(guild_id)
or friends and then looking it up from there, useMemberCache.get(guild_id, user_id)
.Enum.find(guild.members, ...)
, use MemberCache.get(guild.id) |> Enum.find
. The new cache functionsUserCache.get(member.user_id)
to retrieve it.:qlc
and MemberCache.qlc_handle()
. Note that the current ETS cache isUserCache
.If you had some previous functionality in your bot that is problematic to
implement with these new changes, please open an
issue.
Nostrum.Cache.MemberCache
:members
field from Nostrum.Struct.Guild
Nostrum.Cache.MemberCache
Nostrum.Cache.MemberCache.get(guild_id)
to retrieve guild membersNostrum.Cache.GuildCache
callbacks have been removed:
c:member_add/2
c:member_remove/2
c:member_update/2
c:member_chunk/2
Nostrum.Cache.GuildCache
callbacks have been added:
c:member_count_up/1
c:member_count_down/1
Nostrum.Cache.UserCache
c:qlc_handle/1
:user
field from Nostrum.Struct.Guild.Member
:user_id
field can be used to find the matching userGenStage
with :pg
use Nostrum.Consumer
can remain unchangedNostrum.Consumer
will automatically handle events in spawned processesNostrum.ConsumerGroup
for detailed information:joined_at
member field is now a unix timestamp instead of a raw string
t:Nostrum.Struct.Guild.Member.joined_at/0
nil
Nostrum.Cache.MemberCache
Nostrum.Api.get_guild_auto_moderation_rules/1
Nostrum.Api.get_guild_auto_moderation_rule/2
Nostrum.Api.create_guild_auto_moderation_rule/2
Nostrum.Api.modify_guild_auto_moderation_rule/3
Nostrum.Api.delete_guild_auto_moderation_rule/2
t:Nostrum.Consumer.auto_moderation_rule_create/0
t:Nostrum.Consumer.auto_moderation_rule_delete/0
t:Nostrum.Consumer.auto_moderation_rule_update/0
t:Nostrum.Consumer.auto_moderation_rule_execute/0
Nostrum.Struct.Event.AutoModerationRuleExecute
:auto_moderation_configuration
:auto_moderation_execution
Nostrum.Struct.AutoModerationRule
Nostrum.Struct.AutoModerationRule.Action
Nostrum.Struct.AutoModerationRule.ActionMetadata
Nostrum.Struct.AutoModerationRule.TriggerMetadata
Nostrum.Api.start_thread_in_forum_channel/2-3
Nostrum.Struct.Channel
:
:type
may now be 15
to represent a forum channelt:Nostrum.Struct.Channel.default_thread_rate_limit_per_user/0
t:Nostrum.Struct.Channel.forum_tag/0
t:Nostrum.Struct.Channel.applied_tags/0
t:Nostrum.Struct.Channel.default_reaction_emoji/0
:thread_metadata
field has been extended by the following fields:
:invitable
:create_timestamp
t:Nostrum.Struct.Channel.guild_forum_channel/0
has been addedNostrum.Constants.ApplicationCommandOptionType
Nostrum.Constants.ApplicationCommandPermissionType
Nostrum.Constants.ApplicationCommandType
Nostrum.Constants.ButtonStyle
Nostrum.Constants.ChannelType
Nostrum.Constants.ComponentType
Nostrum.Constants.InteractionCallbackType
Nostrum.Constants.InteractionType
Nostrum.Constants.TextInputStyle
Nostrum.Constants.WebhookType
Nostrum.Struct.Guild.AuditLogEntry
t:Nostrum.Consumer.guild_audit_log_entry_create/0
Nostrum.Api.get_webhook_message/2
t:Nostrum.Struct.Guild.Role.icon/0
t:Nostrum.Struct.ApplicationCommandInteractionDataResolved.attachments/0
Nostrum.Api.get_original_interaction_response/1
Nostrum.Api.get_reactions/3-4
t:Nostrum.Struct.Guild.Role.unicode_emoji/0
Nostrum.ConsumerGroup
for detailsREADY
event at INFO
log level as well
IDENTIFYING
was logged, which could lead to believe thatt:Nostrum.Api.allowed_mentions/0
Nostrum.Cache.ChannelCache
behaviour
get/1
with a message directly in the dispatcherget!/1
directly in the dispatcherc:lookup/1
and its dispatch functionlist_guild_threads/1
(Zach Daniel)youtube-dl
(aukuste)DynamicSupervisor
for voice sessions (Brandt Hill)doc
build and source file folders:gun
to the official stable 2.0 release
:remedy_gun
and :remedy_cowlib
:gun
before.Nostrum.Cache.Mapping.ShardPidNum
moduleawait_up
logicuse Bitwise
Published by jchristgit over 1 year ago
Changes since 0.7.0-rc1:
MemberCache.get_with_user/2
Full release notes follow.
Welcome to nostrum 0.7.0, codenamed "launch preparations".
This release brings you support for automod and forum channels, helps you with
navigating through Discord's numbering schemes with the new modules under
Nostrum.Constants
, allows you to retrieve audit log entries over the gateway,
and much more. For the full list of features and bugfixes, see below.
This release contains breaking changes in regards to member caching. If you want the short version, scroll down to the "Breaking changes" section. This part will document the changes and their reasoning.
Two main breaking changes have been performed, that are almost guaranteed to
cause breakage on your bot:
Nostrum.Cache.MemberCache
handles caching guild members, andNostrum.Cache.MemberCache.get_with_users/1
, that will:qlc
join between the member and user cache.For the join function to work, the callback c:qlc_handle/0
has been added to
both Nostrum.Cache.MemberCache
and Nostrum.Cache.UserCache
. It is expected
that more functionality will be built on top of :qlc
in the future,
especially as nostrum approaches its 1.0 release, so it's heavily recommended
to add this callback for any custom consumers. The Erlang documentation
explains how to implement a QLC
table for
any custom caches you may have.
Why were these changes done? Nostrum previously struggled when working with
large guilds. With the ETS-based guild cache, updating a member would mean
fetching the entire guild object from the cache, for ETS, this means making a
full copy of the entire struct. While probably unproblematic for most usecases,
running Nostrum with request_guild_members: true
on large guilds would cause
memory usage to skyrocket for a brief period at the start while Nostrum
struggled to gobble all of the users into the cache. Unfortunately, fixing this
was not possible without breaking the API. The :user
field was removed as the
members change will already require changes on your side, and nostrum
previously did not update users on members properly, causing stale data. We
want the caches to work independently from each other, so this seemed the
proper solution. If you want to have some rough idea of how to change it, see
this commit on
bolt.
Due to the new separation and removal of duplicated user data, nostrum is now
lighter on memory. The "Breaking changes" section below contains a complete
listing of these changes. If you use a third-party command library such as
:nosedrum
, you will likely need to upgrade those as well.
For the breaking changes mentioned above, the following should serve as a
guideline to the full list of breaking changes in the section below:
GuildCache.get(guild_id)
or friends and then looking it up from there, useMemberCache.get(guild_id, user_id)
.Enum.find(guild.members, ...)
, use MemberCache.get(guild.id) |> Enum.find
. The new cache functionsUserCache.get(member.user_id)
to retrieve it.:qlc
and MemberCache.qlc_handle()
. Note that the current ETS cache isUserCache
.If you had some previous functionality in your bot that is problematic to
implement with these new changes, please open an
issue.
Nostrum.Cache.MemberCache
:members
field from Nostrum.Struct.Guild
Nostrum.Cache.MemberCache
Nostrum.Cache.MemberCache.get(guild_id)
to retrieve guild membersNostrum.Cache.GuildCache
callbacks have been removed:
c:member_add/2
c:member_remove/2
c:member_update/2
c:member_chunk/2
Nostrum.Cache.GuildCache
callbacks have been added:
c:member_count_up/1
c:member_count_down/1
Nostrum.Cache.UserCache
c:qlc_handle/1
:user
field from Nostrum.Struct.Guild.Member
:user_id
field can be used to find the matching userGenStage
with :pg
use Nostrum.Consumer
can remain unchangedNostrum.Consumer
will automatically handle events in spawned processesNostrum.ConsumerGroup
for detailed information:joined_at
member field is now a unix timestamp instead of a raw string
t:Nostrum.Struct.Guild.Member.joined_at/0
nil
Nostrum.Cache.MemberCache
Nostrum.Api.get_guild_auto_moderation_rules/1
Nostrum.Api.get_guild_auto_moderation_rule/2
Nostrum.Api.create_guild_auto_moderation_rule/2
Nostrum.Api.modify_guild_auto_moderation_rule/3
Nostrum.Api.delete_guild_auto_moderation_rule/2
t:Nostrum.Consumer.auto_moderation_rule_create/0
t:Nostrum.Consumer.auto_moderation_rule_delete/0
t:Nostrum.Consumer.auto_moderation_rule_update/0
t:Nostrum.Consumer.auto_moderation_rule_execute/0
Nostrum.Struct.Event.AutoModerationRuleExecute
:auto_moderation_configuration
:auto_moderation_execution
Nostrum.Struct.AutoModerationRule
Nostrum.Struct.AutoModerationRule.Action
Nostrum.Struct.AutoModerationRule.ActionMetadata
Nostrum.Struct.AutoModerationRule.TriggerMetadata
Nostrum.Api.start_thread_in_forum_channel/2-3
Nostrum.Struct.Channel
:
:type
may now be 15
to represent a forum channelt:Nostrum.Struct.Channel.default_thread_rate_limit_per_user/0
t:Nostrum.Struct.Channel.forum_tag/0
t:Nostrum.Struct.Channel.applied_tags/0
t:Nostrum.Struct.Channel.default_reaction_emoji/0
:thread_metadata
field has been extended by the following fields:
:invitable
:create_timestamp
t:Nostrum.Struct.Channel.guild_forum_channel/0
has been addedNostrum.Constants.ApplicationCommandOptionType
Nostrum.Constants.ApplicationCommandPermissionType
Nostrum.Constants.ApplicationCommandType
Nostrum.Constants.ButtonStyle
Nostrum.Constants.ChannelType
Nostrum.Constants.ComponentType
Nostrum.Constants.InteractionCallbackType
Nostrum.Constants.InteractionType
Nostrum.Constants.TextInputStyle
Nostrum.Constants.WebhookType
Nostrum.Struct.Guild.AuditLogEntry
t:Nostrum.Consumer.guild_audit_log_entry_create/0
Nostrum.Api.get_webhook_message/2
t:Nostrum.Struct.Guild.Role.icon/0
t:Nostrum.Struct.ApplicationCommandInteractionDataResolved.attachments/0
Nostrum.Api.get_original_interaction_response/1
Nostrum.Api.get_reactions/3-4
t:Nostrum.Struct.Guild.Role.unicode_emoji/0
Nostrum.ConsumerGroup
for detailsREADY
event at INFO
log level as well
IDENTIFYING
was logged, which could lead to believe thatt:Nostrum.Api.allowed_mentions/0
Nostrum.Cache.ChannelCache
behaviour
get/1
with a message directly in the dispatcherget!/1
directly in the dispatcherc:lookup/1
and its dispatch functionlist_guild_threads/1
(Zach Daniel)youtube-dl
(aukuste)DynamicSupervisor
for voice sessions (Brandt Hill)doc
build and source file folders:gun
to the official stable 2.0 release
:remedy_gun
and :remedy_cowlib
:gun
before.Nostrum.Cache.Mapping.ShardPidNum
moduleawait_up
logicuse Bitwise
Published by jchristgit over 1 year ago
Test release for the upcoming 0.7.0 release. If possible, please test!
Full release notes follow.
This release brings you support for automod and forum channels, helps you with
navigating through Discord's numbering schemes with the new modules under
Nostrum.Constants
, allows you to retrieve audit log entries over the gateway,
and much more. For the full list of features and bugfixes, see below.
This release contains breaking changes in regards to member caching. If you want the short version, scroll down to the "Breaking changes" section. This part will document the changes and their reasoning.
Two main breaking changes have been performed, that are almost guaranteed to
cause breakage on your bot:
Nostrum.Cache.MemberCache
handles caching guild members, andNostrum.Cache.MemberCache.get_with_users/1
, that will:qlc
join between the member and user cache.For the join function to work, the callback c:qlc_handle/0
has been added to
both Nostrum.Cache.MemberCache
and Nostrum.Cache.UserCache
. It is expected
that more functionality will be built on top of :qlc
in the future,
especially as nostrum approaches its 1.0 release, so it's heavily recommended
to add this callback for any custom consumers. The Erlang documentation
explains how to implement a QLC
table for
any custom caches you may have.
Why were these changes done? Nostrum previously struggled when working with
large guilds. With the ETS-based guild cache, updating a member would mean
fetching the entire guild object from the cache, for ETS, this means making a
full copy of the entire struct. While probably unproblematic for most usecases,
running Nostrum with request_guild_members: true
on large guilds would cause
memory usage to skyrocket for a brief period at the start while Nostrum
struggled to gobble all of the users into the cache. Unfortunately, fixing this
was not possible without breaking the API. The :user
field was removed as the
members change will already require changes on your side, and nostrum
previously did not update users on members properly, causing stale data. We
want the caches to work independently from each other, so this seemed the
proper solution. If you want to have some rough idea of how to change it, see
this commit on
bolt.
Due to the new separation and removal of duplicated user data, nostrum is now
lighter on memory. The "Breaking changes" section below contains a complete
listing of these changes. If you use a third-party command library such as
:nosedrum
, you will likely need to upgrade those as well.
For the breaking changes mentioned above, the following should serve as a
guideline to the full list of breaking changes in the section below:
GuildCache.get(guild_id)
or friends and then looking it up from there, useMemberCache.get(guild_id, user_id)
.Enum.find(guild.members, ...)
, use MemberCache.get(guild.id) |> Enum.find
. The new cache functionsUserCache.get(member.user_id)
to retrieve it.:qlc
and MemberCache.qlc_handle()
. Note that the current ETS cache isUserCache
.If you had some previous functionality in your bot that is problematic to
implement with these new changes, please open an
issue.
Nostrum.Cache.MemberCache
:members
field from Nostrum.Struct.Guild
Nostrum.Cache.MemberCache
Nostrum.Cache.MemberCache.get(guild_id)
to retrieve guild membersNostrum.Cache.GuildCache
callbacks have been removed:
c:member_add/2
c:member_remove/2
c:member_update/2
c:member_chunk/2
Nostrum.Cache.GuildCache
callbacks have been added:
c:member_count_up/1
c:member_count_down/1
Nostrum.Cache.UserCache
c:qlc_handle/1
:user
field from Nostrum.Struct.Guild.Member
:user_id
field can be used to find the matching userGenStage
with :pg
use Nostrum.Consumer
can remain unchangedNostrum.Consumer
will automatically handle events in spawned processesNostrum.ConsumerGroup
for detailed information:joined_at
member field is now a unix timestamp instead of a raw string
t:Nostrum.Struct.Guild.Member.joined_at/0
nil
Nostrum.Cache.MemberCache
Nostrum.Api.get_guild_auto_moderation_rules/1
Nostrum.Api.get_guild_auto_moderation_rule/2
Nostrum.Api.create_guild_auto_moderation_rule/2
Nostrum.Api.modify_guild_auto_moderation_rule/3
Nostrum.Api.delete_guild_auto_moderation_rule/2
t:Nostrum.Consumer.auto_moderation_rule_create/0
t:Nostrum.Consumer.auto_moderation_rule_delete/0
t:Nostrum.Consumer.auto_moderation_rule_update/0
t:Nostrum.Consumer.auto_moderation_rule_execute/0
Nostrum.Struct.Event.AutoModerationRuleExecute
:auto_moderation_configuration
:auto_moderation_execution
Nostrum.Struct.AutoModerationRule
Nostrum.Struct.AutoModerationRule.Action
Nostrum.Struct.AutoModerationRule.ActionMetadata
Nostrum.Struct.AutoModerationRule.TriggerMetadata
Nostrum.Api.start_thread_in_forum_channel/2-3
Nostrum.Struct.Channel
:
:type
may now be 15
to represent a forum channelt:Nostrum.Struct.Channel.default_thread_rate_limit_per_user/0
t:Nostrum.Struct.Channel.forum_tag/0
t:Nostrum.Struct.Channel.applied_tags/0
t:Nostrum.Struct.Channel.default_reaction_emoji/0
:thread_metadata
field has been extended by the following fields:
:invitable
:create_timestamp
t:Nostrum.Struct.Channel.guild_forum_channel/0
has been addedNostrum.Constants.ApplicationCommandOptionType
Nostrum.Constants.ApplicationCommandPermissionType
Nostrum.Constants.ApplicationCommandType
Nostrum.Constants.ButtonStyle
Nostrum.Constants.ChannelType
Nostrum.Constants.ComponentType
Nostrum.Constants.InteractionCallbackType
Nostrum.Constants.InteractionType
Nostrum.Constants.TextInputStyle
Nostrum.Constants.WebhookType
Nostrum.Struct.Guild.AuditLogEntry
t:Nostrum.Consumer.guild_audit_log_entry_create/0
Nostrum.Api.get_webhook_message/2
t:Nostrum.Struct.Guild.Role.icon/0
t:Nostrum.Struct.ApplicationCommandInteractionDataResolved.attachments/0
Nostrum.Api.get_original_interaction_response/1
Nostrum.Api.get_reactions/3-4
t:Nostrum.Struct.Guild.Role.unicode_emoji/0
Nostrum.ConsumerGroup
for detailsREADY
event at INFO
log level as well
IDENTIFYING
was logged, which could lead to believe thatt:Nostrum.Api.allowed_mentions/0
Nostrum.Cache.ChannelCache
behaviour
get/1
with a message directly in the dispatcherget!/1
directly in the dispatcherc:lookup/1
and its dispatch functionlist_guild_threads/1
(Zach Daniel)youtube-dl
(aukuste)DynamicSupervisor
for voice sessions (Brandt Hill)doc
build and source file folders:gun
to the official stable 2.0 release
:remedy_gun
and :remedy_cowlib
:gun
before.Nostrum.Cache.Mapping.ShardPidNum
moduleawait_up
logicuse Bitwise
Published by jchristgit about 2 years ago
nostrum 0.6.1
Welcome to nostrum 0.6.1, a small bugfix release addressing issues with token validation and typespecs.
Thanks to @Th3-M4jor and @cedeno for their contributions to this release!
Published by jchristgit over 2 years ago
Welcome to nostrum 0.6.0, bringing you message content intents, API v10, voice
improvements, new permissions, and more!
A huge thanks to @Th3-M4jor, @BrandtHill and @daskycodes for their contributions
to this release!
:message_content
:gateway_intents
configuration setting.false
aslisten/2-3
to reuse the previous behaviour.:manage_emojis
permission was renamed to :manage_emojis_and_stickers
:message_content
intent:view_guild_insights
:use_application_commands
:moderate_members
:use_external_stickers
:stream
:request_to_speak
:manage_events
:use_embedded_activities
:locale
and :guild_locale
fieldsNostrum.Voice.start_listen_async/1
t:Nostrum.Voice.VoiceWSState.ssrc_map/0
andNostrum.Voice.get_ssrc_map/1
for details)Nostrum.Voice.pad_opus/1
for details)Nostrum.Voice.get_current_url/1
NoOp
guild cache for effectively disabling the guild cacheNostrum.Token
for verifying Discord Bot tokensmime
version 1 and 2check_token/1
to work with newer token formatsMessage.to_url/1
breaking on numeric IDsUtil.cast
in the Integration
andIntegration.Application
structsnofin
responses in the ratelimiter. Please report these:message_content
intent if relying on content for e.g.Api
modulePublished by jchristgit over 2 years ago
Introducing nostrum 0.5.1 "I don't pick favourites", named after Craig's
favourite cat! The release brings support for threads, a decoder for incoming
voice data, integration events, modal submit interactions, and a bunch more
goodies!
A huge thanks to @Th3-M4jor, @BrandtHill, @frm and @kianmeng for their
contributions to this release!
If you're using streamlink for voice streaming, you may need to update it to >=
3.0 for this release, in order for the stream URL feature to work properly.
Nostrum.Api
functions for working with threadsporcelain
in favour of native ports.ogg
filesPublished by jchristgit over 2 years ago
Enter nostrum 0.5: Raw voice, fleshed-out application command support, pluggable
caches, stickers, typed events, scheduled events, did someone say "switch
websocket library again"?
Thanks to @jb3, @Th3-M4jor, @BrandtHill, @bdanklin, @RealVidy, and the many more
people who contributed to the release with pull requests, bug reports, feature
suggestions, or just by being part of the development channel. A full list of
our contributors, minus the mention spam, is at the bottom. Finally, thanks for
the author of this tag for turning what should have been a day project into a
one and a half year long incursion.
allowed_mentions
have been renamed:
:user
-> :users
{:user, list}
-> {:users, list}
{:role, list}
-> {:roles, list}
type
value for permission overwrites has changed:
"role"
-> 0
"member"
-> 1
:file
option for Nostrum.Api.execute_webhook/3-4
was renamed to:files
and expects a list of files instead of a single file. :file
will:files
instead.Nostrum.Api.bulk_overwrite_global_application_commands/1-2
andNostrum.Api.bulk_overwrite_guild_application_commands/2-3
Nostrum.Struct.ApplicationCommand
Nostrum.Struct.ApplicationCommandInteractionDataResolved
Nostrum.Struct.Component
Nostrum.Struct.Component.ActionRow
Nostrum.Struct.Component.Button
Nostrum.Struct.Component.Option
Nostrum.Struct.Component.SelectMenu
Nostrum.Struct.Message.Component
Nostrum.Struct.ApplicationCommandInteractionData
Nostrum.Struct.ApplicationCommandInteractionDataOption
Nostrum.Struct.Interaction
Nostrum.Struct.Message
Nostrum.Struct.Message.Sticker
Nostrum.Api.modify_guild_member/4
Nostrum.Api.edit_webhook_message/4
Nostrum.Struct.Guild.Member.top_role/2
for retrieving the topmost roleNostrum.Struct.Message.to_url/1
for retrieving a message link for aNostrum.Struct.Channel
), whichNostrum.Struct.Message.type
valuesex_doc
version 0.28CHANNEL_PINS_UPDATE
GUILD_BAN_ADD
GUILD_BAN_REMOVE
GUILD_INTEGRATIONS_UPDATE
MESSAGE_REACTION_ADD
MESSAGE_REACTION_REMOVE
MESSAGE_REACTION_REMOVE_ALL
MESSAGE_REACTION_REMOVE_EMOJI
READY
TYPING_START
VOICE_STATE_UPDATE
VOICE_SERVER_UPDATE
VOICE_READY
event, fired when the bot is ready for sending audio inGUILD_SCHEDULED_EVENT_CREATE
GUILD_SCHEDULED_EVENT_UPDATE
GUILD_SCHEDULED_EVENT_DELETE
GUILD_SCHEDULED_EVENT_USER_ADD
GUILD_SCHEDULED_EVENT_USER_REMOVE
guild_scheduled_events
intentNostrum.Api.execute_webhook/3-4
num_shard: :auto
is now used by default:gun
, which we already useKraigieNostrumCat_
as theex_doc
among othersThanks to these wonderful folks who have contributed to this release:
Published by Kraigie almost 4 years ago
Published by Kraigie almost 4 years ago
Published by Kraigie about 5 years ago
heartbeat_ack
not being reset when reconnecting, creating a loop of reconnecting and then disconnecting shortly after (d424c473972ce27c4e6cfc5318816d648ccb4ea3)Published by Kraigie about 5 years ago
Published by Kraigie over 5 years ago
Nostrum.Struct.Snowflake
to Nostrum.Snowflake
(603da771b0171c71e49109dfb72f26a912037380)Published by Kraigie over 5 years ago