Skip to content

Commit

Permalink
Update README.md and package.json, and fix bugs in VoiceStateUpdate.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
appujet committed Apr 13, 2024
1 parent 47bf24b commit a2052df
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,26 @@ CLIENT_ID="." # This is your bot's client ID. If this value is left blank, bots
```bash
npm start
```
if your prisma client is not generated then follow the below steps [Prisma Setup](#prisma-setup)

6. Invite the bot to your server:

Generate an invite link for your bot and invite it to your server using the Discord Developer Portal or using permissions calculator: <https://discordapi.com/permissions.html>

## Prisma Setup

1. generate the prisma client

```bash
npx prisma generate
```

2. Run the migrations

```bash
npx prisma migrate dev --name init
```

## 🚀 Installation using Docker Compose

This section assumes you have Docker and Docker Compose installed and running correctly.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lavamusic",
"version": "4.0.9",
"version": "4.1.0",
"description": "LavaMusic is a music bot for Discord, written in JavaScript using the Discord.js, Typescript, Shoukaku (Lavalink) library.",
"main": "dist/index.js",
"type": "module",
Expand Down
12 changes: 6 additions & 6 deletions src/events/client/VoiceStateUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export default class VoiceStateUpdate extends Event {
const server = await this.client.db.get_247(newState.guild.id);
if (!server) {
setTimeout(async () => {
const playerVoiceChannel = newState.guild.channels.cache.get(
player.node.manager.connections.get(newState.guild.id).channelId
);
const vc = player.node.manager.connections.get(newState.guild.id);
if (vc && !vc.channelId) return;
const playerVoiceChannel = newState.guild.channels.cache.get(vc.channelId);
if (
player &&
playerVoiceChannel &&
Expand All @@ -77,9 +77,9 @@ export default class VoiceStateUpdate extends Event {
} else {
if (server) return;
setTimeout(async () => {
const playerVoiceChannel = newState.guild.channels.cache.get(
player.node.manager.connections.get(newState.guild.id).channelId
);
const vc = player.node.manager.connections.get(newState.guild.id);
if (vc && !vc.channelId) return;
const playerVoiceChannel = newState.guild.channels.cache.get(vc.channelId);
if (
player &&
playerVoiceChannel &&
Expand Down

0 comments on commit a2052df

Please sign in to comment.