#[non_exhaustive]pub struct SendSoundboardSound {
pub sound_id: SoundboardSoundId,
pub source_guild_id: Option<GuildId>,
}Expand description
The body of Send Soundboard Sound.
discord.js counterpart: the argument of VoiceChannel#sendSoundboardSound.
§Examples
use djs_model::{
id::{GuildId, SoundboardSoundId},
rest::SendSoundboardSound,
};
// A sound of another guild needs that guild's ID.
let mut body = SendSoundboardSound::new(SoundboardSoundId::new(1_270_000_000_000_000_001));
body.source_guild_id = Some(GuildId::new(1_100_000_000_000_000_009));
assert_eq!(
serde_json::to_string(&body)?,
r#"{"sound_id":"1270000000000000001","source_guild_id":"1100000000000000009"}"#
);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sound_id: SoundboardSoundIdThe sound to play.
source_guild_id: Option<GuildId>The guild the sound belongs to, required for sounds of another guild (which also
needs the USE_EXTERNAL_SOUNDS permission); not needed for default sounds.
Implementations§
Source§impl SendSoundboardSound
impl SendSoundboardSound
Sourcepub const fn new(sound_id: SoundboardSoundId) -> Self
pub const fn new(sound_id: SoundboardSoundId) -> Self
Plays sound_id, a default sound or a sound of the voice channel’s guild.
discord.js counterpart: VoiceChannel#sendSoundboardSound.
Trait Implementations§
Source§impl Clone for SendSoundboardSound
impl Clone for SendSoundboardSound
impl Copy for SendSoundboardSound
Source§impl Debug for SendSoundboardSound
impl Debug for SendSoundboardSound
impl Eq for SendSoundboardSound
Source§impl Hash for SendSoundboardSound
impl Hash for SendSoundboardSound
Source§impl PartialEq for SendSoundboardSound
impl PartialEq for SendSoundboardSound
Source§impl Serialize for SendSoundboardSound
impl Serialize for SendSoundboardSound
impl StructuralPartialEq for SendSoundboardSound
Auto Trait Implementations§
impl Freeze for SendSoundboardSound
impl RefUnwindSafe for SendSoundboardSound
impl Send for SendSoundboardSound
impl Sync for SendSoundboardSound
impl Unpin for SendSoundboardSound
impl UnsafeUnpin for SendSoundboardSound
impl UnwindSafe for SendSoundboardSound
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more