From e654c75455b74ac56ba56ab3f85e347ef5785494 Mon Sep 17 00:00:00 2001 From: Yuzu Date: Sat, 3 Sep 2022 20:37:15 -0500 Subject: [PATCH] fix: both readmes were wrong --- README.md | 9 +++++---- packages/core/README.md | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 44d9175..beaa26d 100644 --- a/README.md +++ b/README.md @@ -41,15 +41,16 @@ const commands = [ } ]; -session.events.on('ready', async ({ user }) => { - console.log('Logged in as:', user.username); - await session.upsertApplicationCommands(commands, 'GUILD_ID'); +session.events.on('ready', ({ user }) => { + console.log('Logged in as:', user.tag); + session.upsertApplicationCommands(commands, 'GUILD_ID'); }); session.events.on('interactionCreate', (interaction) => { if (interaction.isCommand()) { + // your commands go here if (interaction.commandName === 'ping') { - interaction.respond({ with: { content: 'pong!' } }); + interaction.respondWith({ content: 'pong!' }); } } }); diff --git a/packages/core/README.md b/packages/core/README.md index 47a4b23..5a73c61 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -16,27 +16,28 @@ yarn add @biscuitland/core ### Example bot `project/index.js`: ```js -import { ChatInputApplicationCommandBuilder, Session } from '@biscuitland/core'; +import { Session } from '@biscuitland/core'; import { GatewayIntents } from '@biscuitland/api-types'; const session = new Session({ token: 'your token', intents: GatewayIntents.Guilds }); const commands = [ - new ChatInputApplicationCommandBuilder() - .setName('ping') - .setDescription('Replies with pong!') - .toJSON() + { + name: 'ping', + description: 'Replies with pong!' + } ]; -session.events.on('ready', async ({ user }) => { - console.log('Logged in as:', user.username); - await session.upsertApplicationCommands(commands, 'GUILD_ID'); +session.events.on('ready', ({ user }) => { + console.log('Logged in as:', user.tag); + session.upsertApplicationCommands(commands, 'GUILD_ID'); }); session.events.on('interactionCreate', (interaction) => { if (interaction.isCommand()) { + // your commands go here if (interaction.commandName === 'ping') { - interaction.respond({ with: { content: 'pong!' } }); + interaction.respondWith({ content: 'pong!' }); } } });