Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

New Voice Channel Effect #2942

Open
vicky5124 opened this issue Aug 16, 2024 · 0 comments
Open

New Voice Channel Effect #2942

vicky5124 opened this issue Aug 16, 2024 · 0 comments

Comments

@vicky5124
Copy link
Contributor

A new event with 4+ new types has been added.

The event VOICE_CHANNEL_EFFECT_SEND in the intent GUILD_VOICE_STATES has been added.
The event is sent when someone sends an effect in a voice channel the bot user is connected to.

It sends a VoiceChannelEffectSend object.

// Mostly psudocode

struct SoundboardSoundId(...);
struct AnimationId(...);

enum_number! {
    #[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, Deserialize, Serialize)]
    #[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))]
    #[non_exhaustive]
    enum AnimationType {
        Premium = 0,
        Basic = 1,
        _ => Unknown(u8),
    }
}

struct VoiceChannelEffectSend {
    /// ID of the channel the effect was sent in.
    channel_id: ChannelId,
    /// ID of the guild the effect was sent in.
    guild_id: GuildId,
    /// ID of the user who sent the effect.
    user_id: UserId,
    /// The emoji sent, for emoji reaction and soundboard effects.
    emoji: Option<Emoji>,
    /// The type of emoji animation, for emoji reaction and soundboard effects.
    animation_type: Option<AnimationType>,
    /// The ID of the emoji animation, for emoji reaction and soundboard effects
    animation_id: AnimationId
    /// The ID of the soundboard sound, for soundboard effects
    sound_id: Option<SoundboardSoundId>,
    /// The volume of the soundboard sound, from 0 to 1, for soundboard effects
    sound_volume: Option<f64>,
}

Note: The Soundboard ID and Animation ID structures have been suggested as part of the implementation, just in case more parts of the soundboard API becomes available for bots in the near future.

Discord API docs change commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant