Skip to content

Commit

Permalink
Fix Issue
Browse files Browse the repository at this point in the history
- Fix reconnect log issue
- Some changes

NOTE: Since the update v2.3.0, i made changes to the mongodb database structure. So, you need to use new mongodb url. Also, I made some change to files please read the README.md carefully.
  • Loading branch information
adh319 committed Oct 11, 2023
1 parent 34d2870 commit 34d2484
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 24 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

## 📢 Features

- ☑️ Used Poru v4 Lavalink Client
- ☑️ Used Poru v4 Lavalink Client **[Latest]**
- ☑️ Slash Commands
- ☑️ Prefix Commands **[Owner Only]**
- ☑️ Dev/Maintenance Mode System **[Owner Only]**
Expand Down Expand Up @@ -90,7 +90,7 @@ Here are some screenshots from my bot **(Screenshots may not look the same coz i
## 📝 Installation

```
git clone --single-branch --branch master https://github.com/Enour-Dev/Lunox.git
git clone https://github.com/adh319/Lunox.git
cd Lunox
npm install
```
Expand All @@ -103,6 +103,7 @@ too (you choose):
```
#########################################
## SEE THE DETAILS ON "/SRC/SETTINGS/CONFIG.JS" FILE ##
## DON'T LEAVE ANY OPTION BELOW EMPTY ##
#########################################
#BOT DETAILS
Expand Down Expand Up @@ -131,7 +132,7 @@ INVITE_URL = #Your bot invite link
IMAGE_URL = #Any direct image link
```

After installation & finished all needed configuration, you can start the bot by either using `npm start` or `node src/sharder.js`.
After installation & finished all needed configuration, you can start the bot by either using `npm start` or `node src/index.js`.

## 🔐 Licensed

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "lunox",
"version": "2.3.0",
"description": "Lunox by @adh319#9370",
"main": "sharder.js",
"main": "src/index.js",
"scripts": {
"start": "node ./src/sharder.js"
"start": "node ./src/index.js"
},
"dependencies": {
"cpu-stat": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/events/botEvents/guild/messageCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports.run = async (client, message) => {
}

//remove prefix for owner
if (client.owner.includes(message.author.id) && !client.owner.includes(client.user.id) && !message.content.startsWith(prefix)) {
if (client.owner === message.author.id && client.owner !== client.user.id && !message.content.startsWith(prefix)) {
prefix = "";
}

Expand Down
2 changes: 1 addition & 1 deletion src/events/botEvents/guild/voiceStateUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports.run = async (client, oldState, newState) => {
if (!oldState.guild.members.cache.get(client.user.id).voice.channelId) return;

// this will make the bot will not be disconneted/destroyed when lefted alone in voice channel if 247 activated.
const data = await Guild.findOne({ guild: newState.guild.id });
const data = await Guild.findOne({ Id: newState.guild.id });
const reconnect = data.reconnect;

if (reconnect.status === true) return;
Expand Down
15 changes: 11 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
const MainClient = require("./lunox.js");
const client = new MainClient();
const { ClusterManager } = require("discord-hybrid-sharding"); //imports the sharding manager
require("dotenv").config();

client.connect();
const manager = new ClusterManager(`${__dirname}/manager.js`, {
totalShards: "auto", // you can set to every number you want but for save mode, use "auto" option
shardsPerClusters: 2, // Default is 2, you can any bigger number you want
totalClusters: "auto", // you can set to every number you want but for save mode, use "auto" option
mode: "process", // you can also choose "worker"
token: process.env.TOKEN || "YOUR_BOT_TOKEN", //paste your token here
});

module.exports = client;
manager.on("clusterCreate", (cluster) => console.log(`[INFO] Launched Cluster ${cluster.id}`));
manager.spawn({ timeout: -1 });
6 changes: 6 additions & 0 deletions src/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const MainClient = require("./lunox.js");
const client = new MainClient();

client.connect();

module.exports = client;
13 changes: 0 additions & 13 deletions src/sharder.js

This file was deleted.

0 comments on commit 34d2484

Please sign in to comment.