Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔩 Install guide, fixes #2

Merged
merged 1 commit into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 76 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<img src="https://user-images.githubusercontent.com/67436391/182243493-2dbaf788-fb39-463b-bcb9-05303d7d4a7f.png" align="center">
<a href="https://github.com/Pexilo/Stealthy/releases" target="_blank">
<img alt="Version" src="https://img.shields.io/badge/version-1.1.0-blue.svg?cacheSeconds=2592000&style=for-the-badge" />
<img alt="Version" src="https://img.shields.io/badge/version-1.1.1-blue.svg?cacheSeconds=2592000&style=for-the-badge" />
</a>
<a href="https://discord.com/api/oauth2/authorize?client_id=877249354954580059&permissions=8&scope=bot%20applications.commands" target="_blank">
<img src="https://dcbadge.vercel.app/api/shield/877249354954580059?bot=true?&theme=blurple" />
Expand Down Expand Up @@ -58,10 +58,10 @@ Stealthy is my first ambitious personal project, it has been under development s
- [x] 🤖 Discord `v13` -> `v14` [2b80de7](https://github.com/Pexilo/Stealthy/commit/2b80de7979f529222495512d52cd9480ee326869)
- [x] 🚀 Sheweny `v3` -> `v4` [2b80de7](https://github.com/Pexilo/Stealthy/commit/2b80de7979f529222495512d52cd9480ee326869)
- [ ] 🗂️ Multiple Role Claim, 🔉 Join to Create systems for the same server
- [ ] 🧮 Role Claim types *(reaction, select menu, buttons)*
- [ ] 🧮 Role Claim types _(reaction, select menu, buttons)_
- [ ] 💬 Languages support

## 🦾 Powerred by
## 🦾 Powered by

<div align="center" style="display:flex;">
<a href="https://discord.js.org/" target="_blank">
Expand All @@ -81,7 +81,7 @@ Stealthy is my first ambitious personal project, it has been under development s
</a>
</div>

##### `DiscordJs v14.1.2`, `Sheweny v4.0.2`, `Mongoose v6.4.3`, `DeeplAPI v1.0.13`, `Inovaperf` (remote server)
##### `DiscordJs v14.1.2`, `Sheweny v4.0.2`, `Mongoose v6.4.3`, `DeeplAPI v1.0.13`, `Inovaperf`

---

Expand All @@ -93,6 +93,78 @@ Stealthy is my first ambitious personal project, it has been under development s

Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/Pexilo/Stealthy/issues).

### 📝 License

[MIT License](https://github.com/Pexilo/Stealthy/blob/main/LICENSE)
Copyright (c) 2022 Pexilo

## ⚙️ Installation

### Requirements

- Node 16.9 or higher

- MongoDB cluster

1. Create an [account](https://account.mongodb.com/account/login)
2. Create a cluster
3. Connect it with "connect your application"
4. Copy your connection string
5. Replace `<password>` with your database access user password

- Deepl Auth Key

1. Create an account
2. Copy your [authentification key](https://www.deepl.com/fr/account/summary)

### Start the bot

- Clone the repo

```
git clone https://github.com/Pexilo/Stealthy.git
```

##### 🤖 BOT INVITE

1. Replace `<clientId>` with your bot Id

``
https://discord.com/api/oauth2/authorize?client_id=<clientId>&permissions=8&scope=bot%20applications.commands
``

2. Invite your bot with the above link to a desired server

_Note: Your bot must have all privileged gateway intents checked to work properly_

##### 🧾 ENV FILE

1. Replace content of `example.env`

```
TOKEN=your-bot-token
DEEPL_API_KEY=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:fx
MONGO_URI=mongodb+srv:https://username:[email protected]/Data
```

2. Rename the file `example.env` > `.env`

##### 🚀 LAUNCH BOT

1. Install dependencies

```
npm install
```

2. Start the bot

```
node .
```

---

### 👏 Show your support

Simply give me a ⭐️ to support me! 😄
3 changes: 3 additions & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TOKEN=your-bot-token
DEEPL_API_KEY=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:fx
MONGO_URI=mongodb+srv:https://username:[email protected]/Data
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "stealthy",
"version": "1.1.0",
"version": "1.1.1",
"description": "Lightweight, easy-to-use Discord bot that aims to enrich the lifestyle of your server",
"main": "src/pm2.config.js",
"main": "src/client.js",
"scripts": {
"start": "nodemon -x \"node src/client.js || touch src/client.js\"",
"dev": "pm2 start src/pm2.config.js --env development && pm2 log 0",
"prod": "pm2 start src/pm2.config.js --env production && pm2 log 0"
},
Expand Down
8 changes: 4 additions & 4 deletions src/client.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { ShewenyClient } = require("sheweny");
const { mongoose } = require("mongoose");
require("dotenv").config();
const { token, mongo_uri, bot_state } = process.env;
const { TOKEN, MONGO_URI, BOT_STATE } = process.env;
const { Partials, GatewayIntentBits } = require("discord.js");

const client = new ShewenyClient({
Expand Down Expand Up @@ -62,13 +62,13 @@ const client = new ShewenyClient({
loadAll: true,
},
},
mode: bot_state,
mode: BOT_STATE,
});

require("./util/functions")(client);

mongoose
.connect(mongo_uri, {
.connect(MONGO_URI, {
autoIndex: false,
maxPoolSize: 10,
serverSelectionTimeoutMS: 5000,
Expand All @@ -78,6 +78,6 @@ mongoose
.then(() => console.log("MongoDB ✅"))
.catch((err) => console.error("MongoDB ❌\n", err.reason));

client.login(token);
client.login(TOKEN);

module.exports = client;
2 changes: 1 addition & 1 deletion src/commands/misc/serverinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module.exports = class ServerInfoCommand extends Command {
}
);

if (guild.premiumTier != 0) {
if (guild.premiumTier !== 0) {
serverinfo.addFields({
name: "💰 " + "Server Boost" + ":",
value: `${"```"}${boostLevel[guild.premiumTier]}${"```"}`,
Expand Down
2 changes: 1 addition & 1 deletion src/events/guild/guildCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ module.exports = class guildCreateEvent extends Event {
]),
],
});
} catch (e) {}
} catch (_e) {}
}
};
4 changes: 2 additions & 2 deletions src/events/ready.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Event } = require("sheweny");
const { ChannelType } = require("discord.js");
const { bot_state } = process.env;
const { BOT_STATE } = process.env;

module.exports = class Ready extends Event {
constructor(client) {
Expand All @@ -20,7 +20,7 @@ module.exports = class Ready extends Event {
);

console.log(
`${client.user.username} ✅ - ${this.client.Capitalize(bot_state)}
`${client.user.username} ✅ - ${this.client.Capitalize(BOT_STATE)}
♦ Servers: ${client.guilds.cache.size}
♦ Users: ${usersCount}
♦ Channels: ${textChannels.size}`
Expand Down
4 changes: 2 additions & 2 deletions src/pm2.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module.exports = {
ignore_watch: [],

env_production: {
bot_state: "production",
BOT_STATE: "production",
},
env_development: {
bot_state: "development",
BOT_STATE: "development",
},

watch_options: {
Expand Down
5 changes: 2 additions & 3 deletions src/util/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const {
ButtonStyle,
ModalBuilder,
TextInputBuilder,
TextInputStyle,
time,
} = require("discord.js");
const prettyMilliseconds = require("pretty-ms");
Expand Down Expand Up @@ -108,7 +107,7 @@ module.exports = (client) => {
free_api: true,
text: text,
target_lang: lang.toUpperCase(),
auth_key: `${process.env.deeplAuthKey}`,
auth_key: `${process.env.DEEPL_API_KEY}`,
})
.then((result) => {
r = result.data.translations[0].text;
Expand All @@ -126,7 +125,7 @@ module.exports = (client) => {
free_api: true,
text: text,
target_lang: lang.toUpperCase(),
auth_key: `${process.env.deeplAuthKey}`,
auth_key: `${process.env.DEEPL_API_KEY}`,
})
.then((result) => {
r = result.data;
Expand Down