From 51a184ab15a0b97196faaf7c7b0be2b36e8db5cb Mon Sep 17 00:00:00 2001 From: The Major Date: Sun, 2 Jun 2024 20:17:31 +0000 Subject: [PATCH] Add since 0.10.0 tags to changes since 0.9.1 --- lib/nostrum/api.ex | 7 +++++++ lib/nostrum/cache/base.ex | 2 ++ lib/nostrum/cache/guild_cache.ex | 1 + lib/nostrum/cache/message_cache.ex | 1 + lib/nostrum/cache/message_cache/mnesia.ex | 1 + lib/nostrum/cache/message_cache/noop.ex | 1 + lib/nostrum/shard/supervisor.ex | 2 ++ lib/nostrum/struct/guild.ex | 1 + lib/nostrum/struct/sticker.ex | 1 + lib/nostrum/struct/sticker/pack.ex | 1 + lib/nostrum/voice/crypto/aes.ex | 1 + lib/nostrum/voice/crypto/chacha.ex | 1 + lib/nostrum/voice/crypto/salsa.ex | 1 + 13 files changed, 21 insertions(+) diff --git a/lib/nostrum/api.ex b/lib/nostrum/api.ex index 78ddff59c..dc7e73b1f 100644 --- a/lib/nostrum/api.ex +++ b/lib/nostrum/api.ex @@ -1424,6 +1424,7 @@ defmodule Nostrum.Api do Returns a `t:Nostrum.Struct.Sticker.t/0`. """ + @doc since: "0.10.0" @spec get_sticker(Snowflake.t()) :: {:ok, Sticker.t()} | error def get_sticker(sticker_id) do request(:get, Constants.sticker(sticker_id)) @@ -1435,6 +1436,7 @@ defmodule Nostrum.Api do Returns a list of `t:Nostrum.Struct.Sticker.t/0`. """ + @doc since: "0.10.0" @spec list_guild_stickers(Guild.id()) :: {:ok, [Sticker.t()]} | error def list_guild_stickers(guild_id) do request(:get, Constants.guild_stickers(guild_id)) @@ -1446,6 +1448,7 @@ defmodule Nostrum.Api do Returns a `t:Nostrum.Struct.Sticker.t/0`. """ + @doc since: "0.10.0" @spec get_guild_sticker(Guild.id(), Sticker.id()) :: Sticker.t() | error def get_guild_sticker(guild_id, sticker_id) do request(:get, Constants.guild_sticker(guild_id, sticker_id)) @@ -1476,6 +1479,7 @@ defmodule Nostrum.Api do Returns a `t:Nostrum.Struct.Sticker.t/0` on success. """ + @doc since: "0.10.0" @spec create_guild_sticker( Guild.id(), Sticker.name(), @@ -1530,6 +1534,7 @@ defmodule Nostrum.Api do Returns an updated sticker on update completion. """ + @doc since: "0.10.0" @spec modify_guild_sticker(Guild.id(), Sticker.id(), %{ name: Sticker.name() | nil, description: Sticker.description() | nil, @@ -1543,6 +1548,7 @@ defmodule Nostrum.Api do @doc ~S""" Delete a guild sticker with the specified ID. """ + @doc since: "0.10.0" @spec delete_guild_sticker(Guild.id(), Sticker.id()) :: {:ok} | error def delete_guild_sticker(guild_id, sticker_id) do request(:delete, Constants.guild_sticker(guild_id, sticker_id)) @@ -1551,6 +1557,7 @@ defmodule Nostrum.Api do @doc ~S""" Get a list of available sticker packs. """ + @doc since: "0.10.0" @spec get_sticker_packs() :: {:ok, [Sticker.Pack.t()]} | error def get_sticker_packs do resp = diff --git a/lib/nostrum/cache/base.ex b/lib/nostrum/cache/base.ex index 17b1aeba7..4ab320c3f 100644 --- a/lib/nostrum/cache/base.ex +++ b/lib/nostrum/cache/base.ex @@ -33,6 +33,7 @@ defmodule Nostrum.Cache.Base do To retrieve the table name used by this cache, use `table/0`. """ + @moduledoc since: "0.10.0" def get_cache_module(cache_name, default) do case @cache_map do %{^cache_name => nil} -> default @@ -41,6 +42,7 @@ defmodule Nostrum.Cache.Base do end end + @moduledoc since: "0.10.0" def get_cache_options(cache_name) do case @cache_map do %{^cache_name => nil} -> [] diff --git a/lib/nostrum/cache/guild_cache.ex b/lib/nostrum/cache/guild_cache.ex index 5e5750da9..cee8f9769 100644 --- a/lib/nostrum/cache/guild_cache.ex +++ b/lib/nostrum/cache/guild_cache.ex @@ -153,6 +153,7 @@ defmodule Nostrum.Cache.GuildCache do Return the old list of stickers before the update, and the updated list of stickers. """ + @doc since: "0.10.0" @callback stickers_update(Guild.id(), stickers :: [map()]) :: {old_stickers :: [Sticker.t()], new_stickers :: [Sticker.t()]} diff --git a/lib/nostrum/cache/message_cache.ex b/lib/nostrum/cache/message_cache.ex index 0e6a17603..ab9ad2504 100644 --- a/lib/nostrum/cache/message_cache.ex +++ b/lib/nostrum/cache/message_cache.ex @@ -30,6 +30,7 @@ defmodule Nostrum.Cache.MessageCache do You need to implement both of them for nostrum to work with your custom cache. """ + @moduledoc since: "0.10.0" @configured_cache Nostrum.Cache.Base.get_cache_module(:messages, @default_cache_implementation) diff --git a/lib/nostrum/cache/message_cache/mnesia.ex b/lib/nostrum/cache/message_cache/mnesia.ex index 92713b572..0bec30eaa 100644 --- a/lib/nostrum/cache/message_cache/mnesia.ex +++ b/lib/nostrum/cache/message_cache/mnesia.ex @@ -43,6 +43,7 @@ if Code.ensure_loaded?(:mnesia) do You can also change the table name used by the cache by setting the `table_name` field in the configuration for the `messages` cache. """ + @moduledoc since: "0.10.0" @config Nostrum.Cache.Base.get_cache_options(:messages) diff --git a/lib/nostrum/cache/message_cache/noop.ex b/lib/nostrum/cache/message_cache/noop.ex index bbc1ed3e6..fb7c8f207 100644 --- a/lib/nostrum/cache/message_cache/noop.ex +++ b/lib/nostrum/cache/message_cache/noop.ex @@ -5,6 +5,7 @@ defmodule Nostrum.Cache.MessageCache.Noop do This cache does not store any messages and always returns `{:error, :not_found}` for any operation. """ + @moduledoc since: "0.10.0" @behaviour Nostrum.Cache.MessageCache diff --git a/lib/nostrum/shard/supervisor.ex b/lib/nostrum/shard/supervisor.ex index 3b610ae67..088217afe 100644 --- a/lib/nostrum/shard/supervisor.ex +++ b/lib/nostrum/shard/supervisor.ex @@ -157,6 +157,7 @@ defmodule Nostrum.Shard.Supervisor do %{shard_num: 4, ...} ``` """ + @doc since: "0.10.0" @spec disconnect(shard_num()) :: resume_information() def disconnect(shard_num) do :"Nostrum.Shard-#{shard_num}" @@ -194,6 +195,7 @@ defmodule Nostrum.Shard.Supervisor do iex> Nostrum.Shard.Supervisor.reconnect(resume) ``` """ + @doc since: "0.10.0" @spec reconnect(resume_information()) :: DynamicSupervisor.on_start_child() def reconnect( %{ diff --git a/lib/nostrum/struct/guild.ex b/lib/nostrum/struct/guild.ex index a1538dd3e..04f2506c0 100644 --- a/lib/nostrum/struct/guild.ex +++ b/lib/nostrum/struct/guild.ex @@ -178,6 +178,7 @@ defmodule Nostrum.Struct.Guild do @type threads :: %{required(Channel.id()) => Channel.t()} | nil @typedoc "Custom stickers registered to the guild" + @typedoc since: "0.10.0" @type stickers :: [Sticker.t()] @typedoc "Hash of the Discovery splash screen" diff --git a/lib/nostrum/struct/sticker.ex b/lib/nostrum/struct/sticker.ex index 88f2399a5..7d5725247 100644 --- a/lib/nostrum/struct/sticker.ex +++ b/lib/nostrum/struct/sticker.ex @@ -3,6 +3,7 @@ defmodule Nostrum.Struct.Sticker do A `Nostrum.Struct.Sticker` represents a sticker that can be sent inside a `Nostrum.Struct.Message`. """ + @moduledoc since: "0.10.0" alias Nostrum.Struct.{Guild, User} alias Nostrum.{Constants, Snowflake, Util} diff --git a/lib/nostrum/struct/sticker/pack.ex b/lib/nostrum/struct/sticker/pack.ex index f67c1bf7b..c2bfcb692 100644 --- a/lib/nostrum/struct/sticker/pack.ex +++ b/lib/nostrum/struct/sticker/pack.ex @@ -2,6 +2,7 @@ defmodule Nostrum.Struct.Sticker.Pack do @moduledoc """ Represents a platform-curated sticker pack on Discord """ + @moduledoc since: "0.10.0" defstruct [ :id, diff --git a/lib/nostrum/voice/crypto/aes.ex b/lib/nostrum/voice/crypto/aes.ex index 6006406a6..7c467ce52 100644 --- a/lib/nostrum/voice/crypto/aes.ex +++ b/lib/nostrum/voice/crypto/aes.ex @@ -30,6 +30,7 @@ defmodule Nostrum.Voice.Crypto.Aes do AES operations. While the Salsa20 and ChaCha20 stream ciphers are typically faster with pure software implementations, hardware acceleration will typically give AES the leg up for performance. """ + @moduledoc since: "0.10.0" @spec encrypt(binary(), <<_::256>>, <<_::96>>, binary()) :: iolist() def encrypt(plain_text, <> = _key, <> = _nonce, aad) do diff --git a/lib/nostrum/voice/crypto/chacha.ex b/lib/nostrum/voice/crypto/chacha.ex index 9eadbee6b..3683e700c 100644 --- a/lib/nostrum/voice/crypto/chacha.ex +++ b/lib/nostrum/voice/crypto/chacha.ex @@ -50,6 +50,7 @@ defmodule Nostrum.Voice.Crypto.Chacha do heavy lifting. If your bot is running on a machine without AES hardware acceleration, you may find that using the chacha encryption mode yields better performance. """ + @moduledoc since: "0.10.0" import Bitwise diff --git a/lib/nostrum/voice/crypto/salsa.ex b/lib/nostrum/voice/crypto/salsa.ex index 96e662817..a550e2511 100644 --- a/lib/nostrum/voice/crypto/salsa.ex +++ b/lib/nostrum/voice/crypto/salsa.ex @@ -61,6 +61,7 @@ defmodule Nostrum.Voice.Crypto.Salsa do as thoughtfully and explicitly as possible with memory usage and performance in mind, using any of the Salsa modes will likely be less performant than ChaCha or AES. """ + @moduledoc since: "0.10.0" import Bitwise