cronokirby/alchemy

Getting caller's voice channel id

InverMN opened this issue · 1 comments

As in title, it there an easy way to get command caller's current voice channel id if any?

Cogs.def ping do
    {:ok, guild_id} = Cogs.guild_id()
    {:ok, %GuildMember{user: %User{id: user_id}}} = Cogs.member()
    {:ok, %VoiceState{channel_id: channel_id}} = Cache.voice_state(guild_id, user_id)

    Cogs.say("Channel ID: " <> channel_id)
end