New plugin CopyStickerLinks: adds Copy/Open Link option to stickers (#3191)
Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
parent
7e028267f1
commit
4403aee3c1
13 changed files with 188 additions and 69 deletions
|
|
@ -1 +1,2 @@
|
|||
export * from "./commands";
|
||||
export * from "./messages";
|
||||
|
|
|
|||
13
packages/discord-types/enums/messages.ts
Normal file
13
packages/discord-types/enums/messages.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
export const enum StickerType {
|
||||
/** an official sticker in a pack */
|
||||
STANDARD = 1,
|
||||
/** a sticker uploaded to a guild for the guild's members */
|
||||
GUILD = 2
|
||||
}
|
||||
|
||||
export const enum StickerFormatType {
|
||||
PNG = 1,
|
||||
APNG = 2,
|
||||
LOTTIE = 3,
|
||||
GIF = 4
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ import { CommandOption } from './Commands';
|
|||
import { User, UserJSON } from '../User';
|
||||
import { Embed, EmbedJSON } from './Embed';
|
||||
import { DiscordRecord } from "../Record";
|
||||
import { StickerFormatType } from "../../../enums";
|
||||
|
||||
/**
|
||||
* TODO: looks like discord has moved over to Date instead of Moment;
|
||||
|
|
@ -92,7 +93,7 @@ export class Message extends DiscordRecord {
|
|||
reactions: MessageReaction[];
|
||||
state: string;
|
||||
stickerItems: {
|
||||
format_type: number;
|
||||
format_type: StickerFormatType;
|
||||
id: string;
|
||||
name: string;
|
||||
}[];
|
||||
|
|
|
|||
35
packages/discord-types/src/common/messages/Sticker.d.ts
vendored
Normal file
35
packages/discord-types/src/common/messages/Sticker.d.ts
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { StickerFormatType, StickerType } from "../../../enums";
|
||||
|
||||
interface BaseSticker {
|
||||
asset: string;
|
||||
available: boolean;
|
||||
description: string;
|
||||
format_type: StickerFormatType;
|
||||
id: string;
|
||||
name: string;
|
||||
sort_value?: number;
|
||||
/** a comma separated string */
|
||||
tags: string;
|
||||
}
|
||||
|
||||
export interface PackSticker extends BaseSticker {
|
||||
pack_id: string;
|
||||
type: StickerType.STANDARD;
|
||||
}
|
||||
|
||||
export interface GuildSticker extends BaseSticker {
|
||||
guild_id: string;
|
||||
type: StickerType.GUILD;
|
||||
}
|
||||
|
||||
export type Sticker = PackSticker | GuildSticker;
|
||||
|
||||
export interface PremiumStickerPack {
|
||||
banner_asset_id?: string;
|
||||
cover_sticker_id?: string;
|
||||
description: string;
|
||||
id: string;
|
||||
name: string;
|
||||
sku_id: string;
|
||||
stickers: PackSticker[];
|
||||
}
|
||||
|
|
@ -2,3 +2,4 @@ export * from "./Commands";
|
|||
export * from "./Message";
|
||||
export * from "./Embed";
|
||||
export * from "./Emoji";
|
||||
export * from "./Sticker";
|
||||
|
|
|
|||
15
packages/discord-types/src/stores/StickersStore.d.ts
vendored
Normal file
15
packages/discord-types/src/stores/StickersStore.d.ts
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { FluxStore, GuildSticker, PremiumStickerPack, Sticker } from "..";
|
||||
|
||||
export type StickerGuildMap = Map<string, GuildSticker[]>;
|
||||
|
||||
export class StickersStore extends FluxStore {
|
||||
getAllGuildStickers(): StickerGuildMap;
|
||||
getRawStickersByGuild(): StickerGuildMap;
|
||||
getPremiumPacks(): PremiumStickerPack[];
|
||||
|
||||
getStickerById(id: string): Sticker | undefined;
|
||||
getStickerPack(id: string): PremiumStickerPack | undefined;
|
||||
getStickersByGuildId(guildId: string): Sticker[] | undefined;
|
||||
|
||||
isPremiumPack(id: string): boolean;
|
||||
}
|
||||
1
packages/discord-types/src/stores/index.d.ts
vendored
1
packages/discord-types/src/stores/index.d.ts
vendored
|
|
@ -11,6 +11,7 @@ export * from "./MessageStore";
|
|||
export * from "./RelationshipStore";
|
||||
export * from "./SelectedChannelStore";
|
||||
export * from "./SelectedGuildStore";
|
||||
export * from "./StickersStore";
|
||||
export * from "./ThemeStore";
|
||||
export * from "./TypingStore";
|
||||
export * from "./UserProfileStore";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue