Skip to content

Commit b9ebf6e

Browse files
committed
suppor and about commands
1 parent 61d1b4a commit b9ebf6e

File tree

7 files changed

+77
-18
lines changed

7 files changed

+77
-18
lines changed

README.md

+31-15
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</a>
2828
<h1 align="center">MonsterHunter Rise Assistant</h1>
2929
<p align="center">
30-
Description here
30+
Monster Hunter Rise Assistant is a Discord bot that provides you informations about Monster Hunter Rise monsters.
3131
<br />
3232
<a href="https://discord.com/api/oauth2/authorize?client_id=943181210987933786&permissions=534723950656&scope=bot%20applications.commands">
3333
Click here to add this Bot to your guild
@@ -72,6 +72,25 @@
7272

7373
## About The Project
7474

75+
MonsterHunterRise Assistant uses built-in Discord Slash Commands in order to respond to the users requests.
76+
77+
All information about monster are stored in **monsters.json**, file createtd taking informations from <a href="https://mhrise.kiranico.com/data/monsters">Kiranico</a>.
78+
79+
For example:
80+
81+
<p align="center">
82+
<img src="imgs/command.png" align="center" width="300" height="90"/>
83+
</p>
84+
85+
Then insert the monster name
86+
87+
<p align="center">
88+
<img src="imgs/command2.png" align="center" width="300" height="90"/>
89+
</p>
90+
91+
<p align="center">
92+
<img src="imgs/command3.png" align="center"/>
93+
</p>
7594

7695
### Built With
7796

@@ -107,30 +126,22 @@ To get a local copy up and running follow these simple steps.
107126

108127
To use the application:
109128

129+
- Create the Discord bot with Discord Developer Portal and copy the token
110130
- Move to the project folder
111131
```sh
112132
cd MonsterHunterRise_Assistant
113-
- Create your configuration file for the Bot
133+
- Create your **.env** file
134+
This .env file is necessary for the bot's token and ID, inside the file paste
114135
```sh
115-
touch config.json
116-
```
117-
This config file is necessary for the bot's token, inside the file paste
118-
```sh
119-
{
120-
"clientId" : "paste here your bot client id",
121-
"guildId" : "paste here your guild id",
122-
"token" : "paste here your token"
123-
}
136+
TOKEN=paste_here_your_bot_token
137+
BOTID=paste_here_your_bot_id
124138
```
125139
- Install the following packages with **npm** package manager
126140
```sh
141+
npm install dotenv
127142
npm install discord.js
128143
npm install @discordjs/builders @discordjs/rest discord-api-types
129144
```
130-
- Deploy the slash commands with
131-
```sh
132-
node src/deploy-commands.js
133-
```
134145
- Run with:
135146
```sh
136147
node src/index.js
@@ -145,6 +156,11 @@ See the [open issues](https://github.com/Federicoand98/MonsterHunterRise_Assista
145156
### Future developments
146157
147158
<!-- CONTRIBUTING -->
159+
- [] Creating a new json db file for weapon informations
160+
- [] Creating a new json db file for armor and skills
161+
- [] Creating a new json db file for quests
162+
- [] Give the possibility to retrieve weapon, armor and quests information
163+
- [] New command that calculate the best weapon and element against monster requested
148164
149165
## Contributing
150166

imgs/command.png

12.4 KB
Loading

imgs/command2.png

9.79 KB
Loading

imgs/command3.png

200 KB
Loading

src/commands/about.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const { SlashCommandBuilder } = require('@discordjs/builders');
2+
const { MessageEmbed } = require('discord.js');
3+
4+
module.exports = {
5+
data: new SlashCommandBuilder()
6+
.setName('about')
7+
.setDescription('About the Bot'),
8+
9+
async execute(interaction) {
10+
var str = 'Monster Hunter Rise Assistant is a Discord bot that provides you informations about Monster Hunter Rise monsters.\n\n';
11+
str += 'GitHub: https://github.com/Federicoand98/MonsterHunterRise_Assistant';
12+
13+
const embed = new MessageEmbed()
14+
.setColor('#0099ff')
15+
.setTitle('About MonsterHunterRise Assistant')
16+
.setAuthor({ name: 'Federyeeco', url: 'https://github.com/Federicoand98'})
17+
.setDescription(str)
18+
.setFooter('MonsterHunter Rise Assistant created by Federico Andrucci');
19+
20+
await interaction.reply({ embeds: [embed] });
21+
}
22+
}

src/commands/support.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const { SlashCommandBuilder } = require('@discordjs/builders');
2+
const { MessageEmbed } = require('discord.js');
3+
require('dotenv').config({ path: '../.env' });
4+
5+
module.exports = {
6+
data: new SlashCommandBuilder()
7+
.setName('support')
8+
.setDescription('Contact the developer'),
9+
10+
async execute(interaction) {
11+
var str = 'If you are having any problem with the bot or you would like to report a bug do not hesitate to contact the developer at:\n\n';
12+
str += 'GitHub: https://github.com/Federicoand98/MonsterHunterRise_Assistant/issues\n';
13+
str += `Email: ${process.env.EMAIL}`;
14+
15+
const embed = new MessageEmbed()
16+
.setColor('#0099ff')
17+
.setTitle('Contact the developer')
18+
.setAuthor({ name: 'Federyeeco', url: 'https://github.com/Federicoand98'})
19+
.setDescription(str)
20+
.setFooter('MonsterHunter Rise Assistant created by Federico Andrucci');
21+
22+
await interaction.reply({ embeds: [embed] });
23+
}
24+
}

src/events/new-guild-register.js

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ module.exports = {
88
console.log("Joined a new guild: " + guild.name);
99
const clientId = process.env.BOTID;
1010

11-
console.log(clientId);
12-
console.log(guild.id);
13-
1411
registerCommands(clientId, guild.id);
1512
}
1613
}

0 commit comments

Comments
 (0)