Skip to content

Commit 9981dbc

Browse files
fix: correct targetUser function and related types
1 parent 65228af commit 9981dbc

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "discord.https",
3-
"version": "3.0.14",
3+
"version": "3.0.15",
44
"description": "Discord.https is a modular library for building and managing Discord HTTP interactions with the Discord API. It provides tools for routing and managing interaction efficiently.",
55
"main": "./dist/index.js",
66
"type": "module",
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
import type {
2-
APIContextMenuInteraction,
3-
APIContextMenuInteractionData,
4-
APIApplicationCommandInteractionData,
5-
APIMessage,
6-
} from "discord-api-types/v10";
71
import { ContextMenuInteraction } from "./Base.js";
82

3+
import type { APIMessage } from "discord-api-types/v10";
4+
95
/**
106
* Represents a message context menu interaction.
117
*
128
*/
9+
1310
export class MessageContextMenuInteraction extends ContextMenuInteraction {
1411
/**
1512
* The message this interaction was sent from
1613
*/
1714
get targetMessage() {
18-
return this.options.getMessage("message");
15+
return this.options.getMessage("message") as APIMessage;
1916
}
2017
}
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
import { ContextMenuInteraction } from "./Base.js";
22

3+
import type {
4+
APIUser,
5+
APIInteractionDataResolvedGuildMember,
6+
} from "discord-api-types/v10";
7+
38
/**
49
* Represents a message context menu interaction.
510
*
611
*/
12+
713
export class UserContextMenuInteraction extends ContextMenuInteraction {
814
/**
915
* The message this interaction was sent from
10-
*
11-
* @type {Message|APIMessage}
12-
* @readonly
1316
*/
1417
get targetUser() {
15-
return this.options.getUser("message");
18+
return this.options.getUser("user") as APIUser;
1619
}
1720
get targetMember() {
18-
return this.options.getMember("user");
21+
return this.options.getMember(
22+
"user"
23+
) as APIInteractionDataResolvedGuildMember;
1924
}
2025
}

0 commit comments

Comments
 (0)