@magicyan/discord 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomItents = void 0;
3
+ exports.CustomPartials = exports.CustomItents = void 0;
4
4
  const discord_js_1 = require("discord.js");
5
5
  const Messages = [
6
6
  discord_js_1.IntentsBitField.Flags.MessageContent,
@@ -40,3 +40,14 @@ exports.CustomItents = {
40
40
  ...Other,
41
41
  ],
42
42
  };
43
+ exports.CustomPartials = {
44
+ All: [
45
+ discord_js_1.Partials.Channel,
46
+ discord_js_1.Partials.GuildMember,
47
+ discord_js_1.Partials.GuildScheduledEvent,
48
+ discord_js_1.Partials.Message,
49
+ discord_js_1.Partials.Reaction,
50
+ discord_js_1.Partials.ThreadMember,
51
+ discord_js_1.Partials.User,
52
+ ]
53
+ };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findEmoji = void 0;
4
+ function findEmoji(guildOrClient) {
5
+ const emojis = guildOrClient.emojis.cache;
6
+ return {
7
+ byName(name, animated) {
8
+ return animated
9
+ ? emojis.find(emoji => emoji.name == name && emoji.animated == animated)
10
+ : emojis.find(emoji => emoji.name == name);
11
+ },
12
+ byId(id, animated) {
13
+ return animated
14
+ ? emojis.find(emoji => emoji.id == id && emoji.animated == animated)
15
+ : emojis.find(emoji => emoji.id == id);
16
+ }
17
+ };
18
+ }
19
+ exports.findEmoji = findEmoji;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@magicyan/discord",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "main": "dist/index.js",
8
8
  "scripts": {
9
9
  "dev": "ts-node src/index.ts",
10
- "build": "tsc"
10
+ "build": "rm -rf dist & rm -rf types & tsc"
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
@@ -28,9 +28,9 @@
28
28
  "homepage": "https://github.com/rinckodev/magicyan/tree/main/packages/discord#readme",
29
29
  "description": "Simple functions to facilitate discord bot development",
30
30
  "dependencies": {
31
- "@magicyan/core": "^1.0.9"
31
+ "@magicyan/core": "^1.0.10"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "discord.js": "^14.14.1"
35
35
  }
36
- }
36
+ }
@@ -1,6 +1,10 @@
1
+ import { Partials } from "discord.js";
1
2
  export declare const CustomItents: {
2
3
  Messages: import("discord.js").GatewayIntentBits[];
3
4
  Guild: import("discord.js").GatewayIntentBits[];
4
5
  Other: import("discord.js").GatewayIntentBits[];
5
6
  All: import("discord.js").GatewayIntentBits[];
6
7
  };
8
+ export declare const CustomPartials: {
9
+ All: Partials[];
10
+ };
@@ -1,4 +1,4 @@
1
- import { EmbedAuthorData, EmbedBuilder, ImageURLOptions, User, EmbedAssetData, Attachment, AttachmentBuilder, ColorResolvable, EmbedFooterData } from "discord.js";
1
+ import { Attachment, AttachmentBuilder, ColorResolvable, EmbedAssetData, EmbedAuthorData, EmbedBuilder, EmbedFooterData, ImageURLOptions, User } from "discord.js";
2
2
  interface CreateEmbedAuthorOptions {
3
3
  user: User;
4
4
  property?: "username" | "displayName" | "id" | "globalName";
@@ -0,0 +1,5 @@
1
+ import type { Client, Guild } from "discord.js";
2
+ export declare function findEmoji(guildOrClient: Guild | Client): {
3
+ byName(name: string, animated?: boolean): import("discord.js").GuildEmoji | undefined;
4
+ byId(id: string, animated?: boolean): import("discord.js").GuildEmoji | undefined;
5
+ };
@@ -1,7 +1,8 @@
1
1
  import type { AnyComponentBuilder, LinkButtonComponentData, TextInputComponentData } from "discord.js";
2
2
  import { ActionRowBuilder, ButtonBuilder, TextInputBuilder } from "discord.js";
3
3
  export declare function createRow<Component extends AnyComponentBuilder>(...components: Component[]): ActionRowBuilder<Component>;
4
- export declare function createModalInput(data: Omit<TextInputComponentData, "type">): ActionRowBuilder<TextInputBuilder>;
4
+ type CreateModalInputData = Omit<TextInputComponentData, "type">;
5
+ export declare function createModalInput(data: CreateModalInputData): ActionRowBuilder<TextInputBuilder>;
5
6
  type CreateLinkButtonData = Omit<LinkButtonComponentData, "style" | "type">;
6
7
  export declare function createLinkButton(data: CreateLinkButtonData): ButtonBuilder;
7
8
  export {};