Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Nuke the ChannelCache from existence #555

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions examples/cache.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule ExampleCommands do
import Nostrum.Snowflake, only: [is_snowflake: 1]

alias Nostrum.Api
alias Nostrum.Cache.{ChannelCache, GuildCache, UserCache}
alias Nostrum.Cache.{GuildCache, UserCache}
alias Nostrum.Struct.User

# Fetch the defined prefix from our config, however,
Expand Down Expand Up @@ -66,15 +66,12 @@ defmodule ExampleCommands do
{Integer.parse(message_user_id), :parse_id},
{:ok, user} <-
get_cached_with_fallback(user_id, &UserCache.get/1, &Api.get_user/1),
{:ok, %{name: channel_name}} <-
get_cached_with_fallback(channel_id, &ChannelCache.get/1, &Api.get_channel/1),
{:ok, %{name: guild_name}} <-
get_cached_with_fallback(guild_id, &GuildCache.get/1, &Api.get_guild/1) do
Api.create_message(
channel_id,
"""
ID #{message_user_id} belongs to: #{User.full_name(user)}
Message sent in channel: ##{channel_name}
Channel belongs to guild: #{guild_name}
"""
)
Expand Down
3 changes: 1 addition & 2 deletions lib/nostrum/cache/cache_supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ defmodule Nostrum.Cache.CacheSupervisor do

See the documentation for the relevant submodules for details:

- `Nostrum.Cache.ChannelCache`
- `Nostrum.Cache.GuildCache`
- `Nostrum.Cache.Me`
- `Nostrum.Cache.MemberCache`
- `Nostrum.Cache.PresenceCache`
- `Nostrum.Cache.UserCache`
"""
Expand All @@ -25,7 +25,6 @@ defmodule Nostrum.Cache.CacheSupervisor do
Nostrum.Cache.GuildCache,
Nostrum.Cache.MemberCache,
Nostrum.Cache.UserCache,
Nostrum.Cache.ChannelCache,
Nostrum.Cache.PresenceCache
]

Expand Down
177 changes: 0 additions & 177 deletions lib/nostrum/cache/channel_cache.ex

This file was deleted.

91 changes: 0 additions & 91 deletions lib/nostrum/cache/channel_cache/ets.ex

This file was deleted.

Loading
Loading