Skip to content

New Voice Channel Effect #2942

Open
Open
@vicky5124

Description

@vicky5124

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions