Skip to content

Commit

Permalink
Merge pull request #37 from Rei-x/discordjs-14-support
Browse files Browse the repository at this point in the history
Discordjs v14 support
  • Loading branch information
Rei-x authored Aug 13, 2022
2 parents 09df88e + 11c55e3 commit 2cd7c35
Show file tree
Hide file tree
Showing 10 changed files with 1,880 additions and 3,257 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16
- run: npm ci
- run: npm run lint && npm run coverage
env:
BOT_TOKEN: ${{secrets.BOT_TOKEN}}
TESTBOT_TOKEN: ${{secrets.TESTBOT_TOKEN}}
GUILD_ID: ${{secrets.GUILD_ID}}
WITAI_KEY: ${{secrets.WITAI_KEY}}
BOT_TOKEN: ${{secrets.BOT_TOKEN}}
TESTBOT_TOKEN: ${{secrets.TESTBOT_TOKEN}}
GUILD_ID: ${{secrets.GUILD_ID}}
WITAI_KEY: ${{secrets.WITAI_KEY}}
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
Expand All @@ -47,7 +47,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: 16
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm run build
Expand Down
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,44 @@ This is an extension for [discord.js](https://discord.js.org) library that makes

## Installation

**Discord.js v13**:
**Discord.js v14**:

```
npm i discord-speech-recognition
```

Checkout simpleBot example in examples directory for ready-to-use bot.

**Discord.js v12**:
**Discord.js v13**:

```
npm i discord-speech-recognition@1
npm i discord-speech-recognition@2
```

You need also dependency for voice, recommended:
**Discord.js v12**:

```
npm i @discordjs/opus
npm i discord-speech-recognition@1
```

You can read more here: <https://discordjs.guide/voice/#installing-dependencies>

## Docs

<https://discordsr.netlify.app/>

## Example usage for discord.js v13
## Example usage for discord.js v14

```javascript
const { Client, Intents } = require("discord.js");
const { Client, GatewayIntentBits } = require("discord.js");
const { joinVoiceChannel } = require("@discordjs/voice");
const { addSpeechEvent } = require("discord-speech-recognition");

const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_MESSAGES,
],
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.Guilds,
],
});
addSpeechEvent(client);

Expand Down
Loading

0 comments on commit 2cd7c35

Please sign in to comment.