Skip to content

Commit 61e3f22

Browse files
committed
refactor: requested changes
1 parent eb6e1e7 commit 61e3f22

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

packages/discord.js/src/structures/CommandInteraction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class CommandInteraction extends BaseInteraction {
210210
deleteReply() {}
211211
followUp() {}
212212
showModal() {}
213-
sendPremiumUpgradeButton() {}
213+
sendPremiumRequired() {}
214214
awaitModalSubmit() {}
215215
}
216216

packages/discord.js/src/structures/MessageComponentInteraction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class MessageComponentInteraction extends BaseInteraction {
9999
deferUpdate() {}
100100
update() {}
101101
showModal() {}
102-
sendPremiumUpgradeButton() {}
102+
sendPremiumRequired() {}
103103
awaitModalSubmit() {}
104104
}
105105

packages/discord.js/src/structures/ModalSubmitInteraction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class ModalSubmitInteraction extends BaseInteraction {
118118
followUp() {}
119119
deferUpdate() {}
120120
update() {}
121-
sendPremiumUpgradeButton() {}
121+
sendPremiumRequired() {}
122122
}
123123

124124
InteractionResponses.applyToClass(ModalSubmitInteraction, 'showModal');

packages/discord.js/src/structures/interfaces/InteractionResponses.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@ class InteractionResponses {
262262

263263
/**
264264
* Responds to the interaction with an upgrade button.
265-
* <warn>Only available for applications with monetization enabled.</warn>
265+
* <info>Only available for applications with monetization enabled.</info>
266266
* @returns {Promise<void>}
267267
*/
268-
async sendPremiumUpgradeButton() {
268+
async sendPremiumRequired() {
269269
if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
270270
await this.client.rest.post(Routes.interactionCallback(this.id, this.token), {
271271
body: {
@@ -319,7 +319,7 @@ class InteractionResponses {
319319
'deferUpdate',
320320
'update',
321321
'showModal',
322-
'sendPremiumUpgradeButton',
322+
'sendPremiumRequired',
323323
'awaitModalSubmit',
324324
];
325325

packages/discord.js/test/monetization.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ client.on(Events.InteractionCreate, async interaction => {
3535
console.log('interaction.entitlements', interaction.entitlements);
3636

3737
if (interaction.commandName === 'test') {
38-
await interaction.sendPremiumUpgradeButton();
38+
await interaction.deferReply();
39+
40+
await interaction.sendPremiumRequired();
3941
}
4042
});
4143

packages/discord.js/typings/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ export abstract class CommandInteraction<Cached extends CacheType = CacheType> e
585585
| ModalComponentData
586586
| APIModalInteractionResponseCallbackData,
587587
): Promise<void>;
588-
public sendPremiumUpgradeButton(): Promise<void>;
588+
public sendPremiumRequired(): Promise<void>;
589589
public awaitModalSubmit(
590590
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
591591
): Promise<ModalSubmitInteraction<Cached>>;
@@ -2202,7 +2202,7 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
22022202
| ModalComponentData
22032203
| APIModalInteractionResponseCallbackData,
22042204
): Promise<void>;
2205-
public sendPremiumUpgradeButton(): Promise<void>;
2205+
public sendPremiumRequired(): Promise<void>;
22062206
public awaitModalSubmit(
22072207
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
22082208
): Promise<ModalSubmitInteraction<Cached>>;
@@ -2386,7 +2386,7 @@ export class ModalSubmitInteraction<Cached extends CacheType = CacheType> extend
23862386
options: InteractionDeferUpdateOptions & { fetchReply: true },
23872387
): Promise<Message<BooleanCache<Cached>>>;
23882388
public deferUpdate(options?: InteractionDeferUpdateOptions): Promise<InteractionResponse<BooleanCache<Cached>>>;
2389-
public sendPremiumUpgradeButton(): Promise<void>;
2389+
public sendPremiumRequired(): Promise<void>;
23902390
public inGuild(): this is ModalSubmitInteraction<'raw' | 'cached'>;
23912391
public inCachedGuild(): this is ModalSubmitInteraction<'cached'>;
23922392
public inRawGuild(): this is ModalSubmitInteraction<'raw'>;

packages/discord.js/typings/index.test-d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2438,7 +2438,7 @@ declare const sku: SKU;
24382438
expectType<Collection<Snowflake, Entitlement>>(interaction.entitlements);
24392439

24402440
if (interaction.isRepliable()) {
2441-
await interaction.sendPremiumUpgradeButton();
2441+
await interaction.sendPremiumRequired();
24422442
}
24432443
});
24442444
}

0 commit comments

Comments
 (0)