mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-11-22 14:41:05 +01:00
fix: pong respond
This commit is contained in:
parent
c24d311fd9
commit
4d5f6f0704
2 changed files with 56 additions and 59 deletions
|
@ -24,7 +24,6 @@ const app = new Hono();
|
||||||
app.get('*', (c) => c.redirect('https://www.youtube.com/watch?v=FMhScnY0dME'));
|
app.get('*', (c) => c.redirect('https://www.youtube.com/watch?v=FMhScnY0dME'));
|
||||||
|
|
||||||
app.post('/interaction', bodyParse(), async(c) => {
|
app.post('/interaction', bodyParse(), async(c) => {
|
||||||
try {
|
|
||||||
const signature = c.req.headers.get('X-Signature-Ed25519');
|
const signature = c.req.headers.get('X-Signature-Ed25519');
|
||||||
const timestamp = c.req.headers.get('X-Signature-Timestamp');
|
const timestamp = c.req.headers.get('X-Signature-Timestamp');
|
||||||
if (!signature || !timestamp) return c.redirect('https://www.youtube.com/watch?v=FMhScnY0dME'); // fireship :D
|
if (!signature || !timestamp) return c.redirect('https://www.youtube.com/watch?v=FMhScnY0dME'); // fireship :D
|
||||||
|
@ -76,9 +75,6 @@ app.post('/interaction', bodyParse(), async(c) => {
|
||||||
content: 'Beep boop. Boop beep?'
|
content: 'Beep boop. Boop beep?'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch(e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await Bun.serve({
|
await Bun.serve({
|
||||||
|
|
|
@ -14,15 +14,16 @@ export class CommandContext {
|
||||||
public resolved?: APIChatInputApplicationCommandInteractionDataResolved;
|
public resolved?: APIChatInputApplicationCommandInteractionDataResolved;
|
||||||
|
|
||||||
public constructor(c: Context, command?: Command, interaction?: APIApplicationCommandInteraction) {
|
public constructor(c: Context, command?: Command, interaction?: APIApplicationCommandInteraction) {
|
||||||
if (interaction.data.type != ApplicationCommandType.ChatInput) return;
|
|
||||||
|
|
||||||
this.context = c;
|
this.context = c;
|
||||||
this.command = command;
|
this.command = command;
|
||||||
|
|
||||||
|
if (interaction) {
|
||||||
this.interaction = interaction as APIChatInputApplicationCommandInteraction;
|
this.interaction = interaction as APIChatInputApplicationCommandInteraction;
|
||||||
this.user = interaction.member.user;
|
this.user = this.interaction.member.user;
|
||||||
this.member = interaction.member;
|
this.member = this.interaction.member;
|
||||||
this.options = interaction.data.options;
|
this.options = this.interaction.data.options;
|
||||||
this.resolved = interaction.data.resolved;
|
this.resolved = this.interaction.data.resolved;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public respond(response: APIInteractionResponse | string) {
|
public respond(response: APIInteractionResponse | string) {
|
||||||
|
|
Loading…
Reference in a new issue