disgroove 1.1.2 → 1.1.3-dev.0ae4518

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.
Files changed (78) hide show
  1. package/README.md +12 -17
  2. package/dist/Client.d.ts +4 -14
  3. package/dist/Client.js +199 -246
  4. package/dist/Client.js.map +1 -1
  5. package/dist/rest/Endpoints.d.ts +2 -2
  6. package/dist/rest/Endpoints.js +14 -14
  7. package/dist/rest/Endpoints.js.map +1 -1
  8. package/dist/structures/Application.d.ts +6 -4
  9. package/dist/structures/Application.js +8 -4
  10. package/dist/structures/Application.js.map +1 -1
  11. package/dist/structures/ApplicationCommand.d.ts +4 -2
  12. package/dist/structures/ApplicationCommand.js +7 -2
  13. package/dist/structures/ApplicationCommand.js.map +1 -1
  14. package/dist/structures/AutoModerationRule.d.ts +3 -1
  15. package/dist/structures/AutoModerationRule.js +5 -0
  16. package/dist/structures/AutoModerationRule.js.map +1 -1
  17. package/dist/structures/Base.d.ts +8 -2
  18. package/dist/structures/Base.js +10 -1
  19. package/dist/structures/Base.js.map +1 -1
  20. package/dist/structures/Channel.d.ts +4 -2
  21. package/dist/structures/Channel.js +7 -2
  22. package/dist/structures/Channel.js.map +1 -1
  23. package/dist/structures/Emoji.d.ts +4 -2
  24. package/dist/structures/Emoji.js +7 -2
  25. package/dist/structures/Emoji.js.map +1 -1
  26. package/dist/structures/Guild.d.ts +4 -2
  27. package/dist/structures/Guild.js +7 -2
  28. package/dist/structures/Guild.js.map +1 -1
  29. package/dist/structures/GuildMember.d.ts +6 -4
  30. package/dist/structures/GuildMember.js +7 -2
  31. package/dist/structures/GuildMember.js.map +1 -1
  32. package/dist/structures/GuildScheduledEvent.d.ts +4 -2
  33. package/dist/structures/GuildScheduledEvent.js +7 -2
  34. package/dist/structures/GuildScheduledEvent.js.map +1 -1
  35. package/dist/structures/GuildTemplate.d.ts +3 -1
  36. package/dist/structures/GuildTemplate.js +5 -0
  37. package/dist/structures/GuildTemplate.js.map +1 -1
  38. package/dist/structures/Integration.d.ts +8 -2
  39. package/dist/structures/Integration.js +7 -2
  40. package/dist/structures/Integration.js.map +1 -1
  41. package/dist/structures/Interaction.d.ts +4 -2
  42. package/dist/structures/Interaction.js +7 -2
  43. package/dist/structures/Interaction.js.map +1 -1
  44. package/dist/structures/Invite.d.ts +4 -2
  45. package/dist/structures/Invite.js +7 -2
  46. package/dist/structures/Invite.js.map +1 -1
  47. package/dist/structures/Message.d.ts +10 -2
  48. package/dist/structures/Message.js +7 -2
  49. package/dist/structures/Message.js.map +1 -1
  50. package/dist/structures/Role.d.ts +6 -2
  51. package/dist/structures/Role.js +7 -2
  52. package/dist/structures/Role.js.map +1 -1
  53. package/dist/structures/StageInstance.d.ts +3 -1
  54. package/dist/structures/StageInstance.js +5 -0
  55. package/dist/structures/StageInstance.js.map +1 -1
  56. package/dist/structures/Sticker.d.ts +4 -2
  57. package/dist/structures/Sticker.js +7 -2
  58. package/dist/structures/Sticker.js.map +1 -1
  59. package/dist/structures/Team.d.ts +13 -0
  60. package/dist/structures/Team.js +36 -0
  61. package/dist/structures/Team.js.map +1 -1
  62. package/dist/structures/User.d.ts +4 -2
  63. package/dist/structures/User.js +7 -2
  64. package/dist/structures/User.js.map +1 -1
  65. package/dist/structures/VoiceState.d.ts +4 -2
  66. package/dist/structures/VoiceState.js +7 -2
  67. package/dist/structures/VoiceState.js.map +1 -1
  68. package/dist/structures/Webhook.d.ts +4 -2
  69. package/dist/structures/Webhook.js +9 -4
  70. package/dist/structures/Webhook.js.map +1 -1
  71. package/dist/structures/index.d.ts +1 -0
  72. package/dist/structures/index.js +1 -0
  73. package/dist/structures/index.js.map +1 -1
  74. package/dist/types/user.d.ts +1 -1
  75. package/dist/utils/jsoners.d.ts +1 -15
  76. package/dist/utils/jsoners.js +1 -17
  77. package/dist/utils/jsoners.js.map +1 -1
  78. package/package.json +1 -1
package/README.md CHANGED
@@ -31,24 +31,12 @@ const {
31
31
  Client,
32
32
  GatewayIntents,
33
33
  ActivityType,
34
- StatusTypes,
35
34
  InteractionType,
36
35
  InteractionCallbackType,
37
36
  MessageFlags,
38
37
  } = require("disgroove");
39
38
  const client = new Client("token", {
40
39
  intents: GatewayIntents.All,
41
- presence: {
42
- activities: [
43
- {
44
- name: "/ping",
45
- type: ActivityType.Watching,
46
- createdAt: Date.now(),
47
- },
48
- ],
49
- status: StatusTypes.Online,
50
- afk: false,
51
- }, // Set the bot presence to "Watching /ping"
52
40
  });
53
41
 
54
42
  client.on("ready", async () => {
@@ -58,13 +46,20 @@ client.on("ready", async () => {
58
46
 
59
47
  const application = await client.getApplication(); // Get the bot application
60
48
 
61
- await application.createGlobalApplicationCommand({
49
+ application.createGlobalApplicationCommand({
62
50
  name: "ping",
63
- description: "Reply with Pong! ",
51
+ description: "Reply with Pong! 🏓",
64
52
  }); // Create a global application command named "ping"
53
+
54
+ client.updatePresence({
55
+ activity: {
56
+ name: "/ping",
57
+ type: ActivityType.Watching,
58
+ },
59
+ }); // Update the bot presence to "Watching /ping"
65
60
  });
66
61
 
67
- client.on("interactionCreate", (interaction) => {
62
+ client.on("interactionCreate", async (interaction) => {
68
63
  if (interaction.type !== InteractionType.ApplicationCommand) return; // Check if the interaction is an application command
69
64
 
70
65
  if (interaction.data.name === "ping") {
@@ -72,10 +67,10 @@ client.on("interactionCreate", (interaction) => {
72
67
  interaction.createResponse({
73
68
  type: InteractionCallbackType.ChannelMessageWithSource,
74
69
  data: {
75
- content: "Pong! ",
70
+ content: "Pong! 🏓",
76
71
  flags: MessageFlags.Ephemeral,
77
72
  },
78
- }); // Reply with an ephemeral message "Pong! "
73
+ }); // Reply with an ephemeral message "Pong! 🏓"
79
74
  }
80
75
  });
81
76
 
package/dist/Client.d.ts CHANGED
@@ -6,14 +6,9 @@ import { Application, AutoModerationRule, Channel, Guild, GuildMember, GuildSche
6
6
  import type { Activity, JSONAuditLogEntry, AutoModerationActionExectionEventFields, JSONAutoModerationRule, JSONChannel, ChannelPinsUpdateEventFields, JSONGuildApplicationCommandPermissions, GuildBanAddEventFields, GuildBanRemoveEventFields, GuildDeleteEventFields, GuildEmojisUpdateEventFields, GuildIntegrationsUpdateEventFields, GuildMemberRemoveEventFields, GuildMemberUpdateEventFields, GuildMembersChunkEventFields, GuildRoleCreateEventFields, GuildRoleDeleteEventFields, GuildRoleUpdateEventFields, JSONGuildScheduledEvent, GuildScheduledEventUserAddEventFields, GuildScheduledEventUserRemoveEventFields, GuildStickersUpdateEventFields, IntegrationDeleteEventFields, JSONInvite, InviteCreateEventFields, InviteDeleteEventFields, MessageDeleteBulkEventFields, MessageDeleteEventFields, MessageReactionAddEventFields, MessageReactionRemoveAllEventFields, MessageReactionRemoveEmojiEventFields, MessageReactionRemoveEventFields, PresenceUpdateEventFields, JSONRole, JSONStageInstance, JSONStickerPack, ThreadListSyncEventFields, JSONThreadMember, ThreadMembersUpdateEventFields, TypingStartEventFields, JSONVoiceRegion, VoiceServerUpdateEventFields, WebhooksUpdateEventFields } from "./types";
7
7
  import EventEmitter from "node:events";
8
8
  export interface ClientOptions {
9
- intents?: GatewayIntents | number;
9
+ intents?: number | Array<number>;
10
10
  shards?: number;
11
11
  auth?: "Bot" | "Bearer";
12
- presence?: {
13
- activities: Array<Activity>;
14
- status: StatusTypes;
15
- afk: boolean;
16
- };
17
12
  }
18
13
  export interface ClientEvents {
19
14
  hello: [
@@ -115,11 +110,6 @@ export declare class Client extends EventEmitter {
115
110
  intents: GatewayIntents | number;
116
111
  shards: number;
117
112
  auth: "Bot" | "Bearer";
118
- presence?: {
119
- activities: Array<Activity>;
120
- status: StatusTypes;
121
- afk: boolean;
122
- };
123
113
  rest: REST;
124
114
  ws: WebSocket;
125
115
  constructor(token: string, options?: ClientOptions);
@@ -209,9 +199,9 @@ export declare class Client extends EventEmitter {
209
199
  }>;
210
200
  /** https://discord.com/developers/docs/topics/gateway-events#update-presence */
211
201
  updatePresence(options: {
212
- activities: Array<Activity>;
213
- status: StatusTypes;
214
- afk: boolean;
202
+ activity?: Pick<Activity, "name" | "type" | "url">;
203
+ status?: StatusTypes;
204
+ afk?: boolean;
215
205
  }): void;
216
206
  /** https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information */
217
207
  getOAuth2Application(): Promise<Application>;