-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into audit-log-types
- Loading branch information
Showing
13 changed files
with
186 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/discord.js/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
const VoiceChannelEffect = require('../../../structures/VoiceChannelEffect'); | ||
const Events = require('../../../util/Events'); | ||
|
||
module.exports = (client, { d: data }) => { | ||
const guild = client.guilds.cache.get(data.guild_id); | ||
if (!guild) return; | ||
|
||
/** | ||
* Emmited when someone sends an effect, such as an emoji reaction, in a voice channel the client is connected to. | ||
* @event Client#voiceChannelEffectSend | ||
* @param {VoiceChannelEffect} voiceChannelEffect The sent voice channel effect | ||
*/ | ||
client.emit(Events.VoiceChannelEffectSend, new VoiceChannelEffect(data, guild)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
'use strict'; | ||
|
||
const { Emoji } = require('./Emoji'); | ||
|
||
/** | ||
* Represents an effect used in a {@link VoiceChannel}. | ||
*/ | ||
class VoiceChannelEffect { | ||
constructor(data, guild) { | ||
/** | ||
* The guild where the effect was sent from. | ||
* @type {Guild} | ||
*/ | ||
this.guild = guild; | ||
|
||
/** | ||
* The id of the channel the effect was sent in. | ||
* @type {Snowflake} | ||
*/ | ||
this.channelId = data.channel_id; | ||
|
||
/** | ||
* The id of the user that sent the effect. | ||
* @type {Snowflake} | ||
*/ | ||
this.userId = data.user_id; | ||
|
||
/** | ||
* The emoji of the effect. | ||
* @type {?Emoji} | ||
*/ | ||
this.emoji = data.emoji ? new Emoji(guild.client, data.emoji) : null; | ||
|
||
/** | ||
* The animation type of the effect. | ||
* @type {?VoiceChannelEffectSendAnimationType} | ||
*/ | ||
this.animationType = data.animation_type ?? null; | ||
|
||
/** | ||
* The animation id of the effect. | ||
* @type {?number} | ||
*/ | ||
this.animationId = data.animation_id ?? null; | ||
|
||
/** | ||
* The id of the soundboard sound for soundboard effects. | ||
* @type {?(Snowflake|number)} | ||
*/ | ||
this.soundId = data.sound_id ?? null; | ||
|
||
/** | ||
* The volume of the soundboard sound [0-1] for soundboard effects. | ||
* @type {?number} | ||
*/ | ||
this.soundVolume = data.sound_volume ?? null; | ||
} | ||
|
||
/** | ||
* The channel the effect was sent in. | ||
* @type {?VoiceChannel} | ||
* @readonly | ||
*/ | ||
get channel() { | ||
return this.guild.channels.cache.get(this.channelId) ?? null; | ||
} | ||
} | ||
|
||
module.exports = VoiceChannelEffect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.