mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: both readmes were wrong
This commit is contained in:
parent
8bbdbeed64
commit
e654c75455
@ -41,15 +41,16 @@ const commands = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
session.events.on('ready', async ({ user }) => {
|
session.events.on('ready', ({ user }) => {
|
||||||
console.log('Logged in as:', user.username);
|
console.log('Logged in as:', user.tag);
|
||||||
await session.upsertApplicationCommands(commands, 'GUILD_ID');
|
session.upsertApplicationCommands(commands, 'GUILD_ID');
|
||||||
});
|
});
|
||||||
|
|
||||||
session.events.on('interactionCreate', (interaction) => {
|
session.events.on('interactionCreate', (interaction) => {
|
||||||
if (interaction.isCommand()) {
|
if (interaction.isCommand()) {
|
||||||
|
// your commands go here
|
||||||
if (interaction.commandName === 'ping') {
|
if (interaction.commandName === 'ping') {
|
||||||
interaction.respond({ with: { content: 'pong!' } });
|
interaction.respondWith({ content: 'pong!' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -16,27 +16,28 @@ yarn add @biscuitland/core
|
|||||||
### Example bot
|
### Example bot
|
||||||
`project/index.js`:
|
`project/index.js`:
|
||||||
```js
|
```js
|
||||||
import { ChatInputApplicationCommandBuilder, Session } from '@biscuitland/core';
|
import { Session } from '@biscuitland/core';
|
||||||
import { GatewayIntents } from '@biscuitland/api-types';
|
import { GatewayIntents } from '@biscuitland/api-types';
|
||||||
|
|
||||||
const session = new Session({ token: 'your token', intents: GatewayIntents.Guilds });
|
const session = new Session({ token: 'your token', intents: GatewayIntents.Guilds });
|
||||||
|
|
||||||
const commands = [
|
const commands = [
|
||||||
new ChatInputApplicationCommandBuilder()
|
{
|
||||||
.setName('ping')
|
name: 'ping',
|
||||||
.setDescription('Replies with pong!')
|
description: 'Replies with pong!'
|
||||||
.toJSON()
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
session.events.on('ready', async ({ user }) => {
|
session.events.on('ready', ({ user }) => {
|
||||||
console.log('Logged in as:', user.username);
|
console.log('Logged in as:', user.tag);
|
||||||
await session.upsertApplicationCommands(commands, 'GUILD_ID');
|
session.upsertApplicationCommands(commands, 'GUILD_ID');
|
||||||
});
|
});
|
||||||
|
|
||||||
session.events.on('interactionCreate', (interaction) => {
|
session.events.on('interactionCreate', (interaction) => {
|
||||||
if (interaction.isCommand()) {
|
if (interaction.isCommand()) {
|
||||||
|
// your commands go here
|
||||||
if (interaction.commandName === 'ping') {
|
if (interaction.commandName === 'ping') {
|
||||||
interaction.respond({ with: { content: 'pong!' } });
|
interaction.respondWith({ content: 'pong!' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user