Skip to content

Commit

Permalink
Rewrite doc-example to not be a doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed Apr 19, 2024
1 parent b0cb647 commit e6e1b07
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/nostrum/struct/channel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,17 @@ defmodule Nostrum.Struct.Channel do
### Example
```elixir
iex(20)> channel_id = 1229955694258684005
1229955694258684005
iex(21)> guild_id = Nostrum.Cache.ChannelGuildMapping.get(channel_id)
> guild_id = Nostrum.Cache.ChannelGuildMapping.get(1229955694258684005)
1226944827137069107
iex(22)> {:ok, guild} = Nostrum.Cache.GuildCache.get(guild_id)
> {:ok, guild} = Nostrum.Cache.GuildCache.get(guild_id)
{:ok,
%Nostrum.Struct.Guild{
id: 1226944827137069107,
name: "nostrum test",
name: "Craig Cat Zone",
...
}}
iex(24)> guild.channels[channel_id].name
"test"
> guild.channels[channel_id].name
"cat-general"
```
## Helper Functions
Expand Down

0 comments on commit e6e1b07

Please sign in to comment.