mirror of
https://github.com/discordjs/discord.js.git
synced 2026-05-29 15:10:09 +00:00
Co-authored-by: SpaceEEC <spaceeec@yahoo.com> Co-authored-by: Antonio Román <kyradiscord@gmail.com> Co-authored-by: Tiemen <ThaTiemsz@users.noreply.github.com> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: BannerBomb <BannerBomb55@gmail.com> Co-authored-by: Noel <icrawltogo@gmail.com> Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
21 lines
632 B
JavaScript
21 lines
632 B
JavaScript
'use strict';
|
|
|
|
const Action = require('./Action');
|
|
const { Events } = require('../../util/Constants');
|
|
|
|
class GuildStickerCreateAction extends Action {
|
|
handle(guild, createdSticker) {
|
|
const already = guild.stickers.cache.has(createdSticker.id);
|
|
const sticker = guild.stickers._add(createdSticker);
|
|
/**
|
|
* Emitted whenever a custom sticker is created in a guild.
|
|
* @event Client#stickerCreate
|
|
* @param {Sticker} sticker The sticker that was created
|
|
*/
|
|
if (!already) this.client.emit(Events.GUILD_STICKER_CREATE, sticker);
|
|
return { sticker };
|
|
}
|
|
}
|
|
|
|
module.exports = GuildStickerCreateAction;
|