@magicyan/discord 1.0.2 → 1.0.4

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.
package/README.md CHANGED
@@ -86,7 +86,7 @@ createLinkButton({ url, label: "My github" });
86
86
 
87
87
  You can create an embed author easily with a User object
88
88
  ```ts
89
- const { user } = interactoion
89
+ const { user } = interaction
90
90
 
91
91
  new EmbedBuilder({
92
92
  author: createEmbedAuthor({ user }),
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomItents = void 0;
4
+ const discord_js_1 = require("discord.js");
5
+ const Messages = [
6
+ discord_js_1.IntentsBitField.Flags.MessageContent,
7
+ discord_js_1.IntentsBitField.Flags.GuildMessages,
8
+ discord_js_1.IntentsBitField.Flags.GuildMessageReactions,
9
+ discord_js_1.IntentsBitField.Flags.GuildMessageTyping,
10
+ discord_js_1.IntentsBitField.Flags.DirectMessages,
11
+ discord_js_1.IntentsBitField.Flags.DirectMessageReactions,
12
+ discord_js_1.IntentsBitField.Flags.DirectMessageTyping,
13
+ ];
14
+ const Guild = [
15
+ discord_js_1.IntentsBitField.Flags.GuildEmojisAndStickers,
16
+ discord_js_1.IntentsBitField.Flags.GuildIntegrations,
17
+ discord_js_1.IntentsBitField.Flags.GuildInvites,
18
+ discord_js_1.IntentsBitField.Flags.GuildMembers,
19
+ discord_js_1.IntentsBitField.Flags.GuildMessageReactions,
20
+ discord_js_1.IntentsBitField.Flags.GuildMessageTyping,
21
+ discord_js_1.IntentsBitField.Flags.GuildMessages,
22
+ discord_js_1.IntentsBitField.Flags.GuildModeration,
23
+ discord_js_1.IntentsBitField.Flags.GuildPresences,
24
+ discord_js_1.IntentsBitField.Flags.GuildScheduledEvents,
25
+ discord_js_1.IntentsBitField.Flags.GuildVoiceStates,
26
+ discord_js_1.IntentsBitField.Flags.GuildWebhooks,
27
+ discord_js_1.IntentsBitField.Flags.Guilds,
28
+ ];
29
+ const Other = [
30
+ discord_js_1.IntentsBitField.Flags.AutoModerationConfiguration,
31
+ discord_js_1.IntentsBitField.Flags.AutoModerationExecution,
32
+ ];
33
+ exports.CustomItents = {
34
+ Messages,
35
+ Guild,
36
+ Other,
37
+ All: [
38
+ ...Messages,
39
+ ...Guild,
40
+ ...Other,
41
+ ],
42
+ };
@@ -11,6 +11,8 @@ function createModalInput(data) {
11
11
  }
12
12
  exports.createModalInput = createModalInput;
13
13
  function createLinkButton(data) {
14
+ if (!data.label)
15
+ data.label = data.url;
14
16
  return new discord_js_1.ButtonBuilder({ style: discord_js_1.ButtonStyle.Link, ...data });
15
17
  }
16
18
  exports.createLinkButton = createLinkButton;
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants/client"), exports);
17
18
  __exportStar(require("./functions/utils"), exports);
18
19
  __exportStar(require("./functions/embeds"), exports);
19
20
  __exportStar(require("@magicyan/core"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicyan/discord",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -18,12 +18,14 @@
18
18
  "typescript": "^5.2.2"
19
19
  },
20
20
  "bugs": {
21
- "url": "https://github.com/rinckodev/magician/issues"
21
+ "url": "https://github.com/rinckodev/magicyan/issues"
22
22
  },
23
- "homepage": "https://github.com/rinckodev/magician#readme",
24
- "description": "",
23
+ "homepage": "https://github.com/rinckodev/magicyan/tree/main/packages/discord#readme",
24
+ "description": "imple functions to facilitate discord bot development",
25
25
  "dependencies": {
26
- "@magicyan/core": "^1.0.3",
26
+ "@magicyan/core": "^1.0.5"
27
+ },
28
+ "peerDependencies": {
27
29
  "discord.js": "^14.13.0"
28
30
  }
29
31
  }
@@ -0,0 +1,6 @@
1
+ export declare const CustomItents: {
2
+ Messages: import("discord.js").GatewayIntentBits[];
3
+ Guild: import("discord.js").GatewayIntentBits[];
4
+ Other: import("discord.js").GatewayIntentBits[];
5
+ All: import("discord.js").GatewayIntentBits[];
6
+ };
@@ -0,0 +1,10 @@
1
+ import { EmbedAuthorData, ImageURLOptions, User } from "discord.js";
2
+ export declare function createEmbedAuthor({ user, property, imageSize: size, iconURL, url, prefix, suffix }: {
3
+ user: User;
4
+ property?: keyof Pick<User, "username" | "displayName" | "id">;
5
+ imageSize?: ImageURLOptions["size"];
6
+ iconURL?: string;
7
+ url?: string;
8
+ prefix?: string;
9
+ suffix?: string;
10
+ }): EmbedAuthorData;
@@ -0,0 +1,4 @@
1
+ import { ActionRowBuilder, AnyComponentBuilder, ButtonBuilder, LinkButtonComponentData, TextInputBuilder, TextInputComponentData } from "discord.js";
2
+ export declare function createRow<Component extends AnyComponentBuilder>(...components: Component[]): ActionRowBuilder<Component>;
3
+ export declare function createModalInput(data: Omit<TextInputComponentData, "type">): ActionRowBuilder<TextInputBuilder>;
4
+ export declare function createLinkButton(data: Omit<LinkButtonComponentData, "style" | "type">): ButtonBuilder;
package/types/index.d.ts CHANGED
@@ -1,30 +1,4 @@
1
- import {
2
- EmbedAuthorData,
3
- ImageURLOptions,
4
- User,
5
- ActionRowBuilder,
6
- AnyComponentBuilder,
7
- ButtonBuilder,
8
- LinkButtonComponentData,
9
- TextInputBuilder,
10
- TextInputComponentData
11
- } from "discord.js";
12
-
13
- export declare function createEmbedAuthor({
14
- user,property, imageSize: size, iconURL, url, prefix, suffix
15
- }:{
16
- user: User;
17
- property?: keyof Pick<User, "username" | "displayName" | "id">;
18
- imageSize?: ImageURLOptions["size"];
19
- iconURL?: string;
20
- url?: string;
21
- prefix?: string;
22
- suffix?: string;
23
- }): EmbedAuthorData;
24
-
25
- export declare function createRow<Component extends AnyComponentBuilder = AnyComponentBuilder>(...components: Component[]): ActionRowBuilder<Component>;
26
- export declare function createModalInput(data: Omit<TextInputComponentData, "type">): ActionRowBuilder<TextInputBuilder>;
27
- export declare function createLinkButton(data: Omit<LinkButtonComponentData, "style" | "type">): ButtonBuilder;
28
-
29
- // external
30
- export * from "@magicyan/core";
1
+ export * from "./constants/client";
2
+ export * from "./functions/utils";
3
+ export * from "./functions/embeds";
4
+ export * from "@magicyan/core";
package/tsconfig.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "lib": ["ESNext"],
4
- "target": "ESNext",
5
- "module": "CommonJS",
6
- "moduleResolution": "Node",
7
- "allowSyntheticDefaultImports": true,
8
- "esModuleInterop": true,
9
- "forceConsistentCasingInFileNames": true,
10
- "strict": true,
11
- "skipLibCheck": true,
12
- "skipDefaultLibCheck": true,
13
- "resolveJsonModule": true,
14
- "emitDecoratorMetadata": true,
15
- "experimentalDecorators": true,
16
- "rootDir": "src",
17
- "outDir": "dist",
18
- "declaration": true
19
- },
20
- "include": [
21
- "src"
22
- ],
23
- "exclude": ["node_modules"]
24
- }