Skip to content

Commit

Permalink
Merge pull request #67 from C0casio45/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
C0casio45 authored May 16, 2022
2 parents 6753ac4 + 28b38cf commit be01042
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
14 changes: 10 additions & 4 deletions bot_modules/faceit.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ module.exports = {
const options = {
hostname: "open.faceit.com",
port: 443,
path: `/data/v4/search/players?nickname=${
pseudo[pseudo.length - 1]
}&offset=0&limit=1`,
path: `/data/v4/search/players?nickname=${pseudo[pseudo.length - 1]
}&offset=0&limit=1`,
method: "GET",
headers: {
Authorization: `Bearer ${faceit.clientAPIKey}`,
Expand Down Expand Up @@ -61,7 +60,14 @@ module.exports = {
// Body:
// {"hubId":"HUB_ID","reason":"REASON","userId":"USER_ID"}

let userId = await this.GetUserToken(userLink);
let userId;

try {
userId = await this.GetUserToken(userLink);
} catch (expression) {
return callback(true, `User not found : ${expression}`);
}

let modToken = faceit.token;

const data = JSON.stringify({
Expand Down
2 changes: 1 addition & 1 deletion commands/ban.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ module.exports = {
) {
quiz(i + 1);
} else {
closeTickets(liengame, rmsg);
await closeTickets(liengame, rmsg);
}
})
.catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion utils/embeds/EmbedMessageFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MessageFactory {
return this;
}

newban() {
newBan() {
this.setAuthor("Nouvelle entrée de banissement");
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion utils/embeds/MessagesLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Message {
}

static requestMoveToMp() {
return new MessageFactory(`Merci d'aller voir vos messages privés`).rappelUnban().embed;
return new MessageFactory(`Merci d'aller voir vos messages privés`).newBan().embed;
}

static requestOtherBans(nbEntreeBan, array) {
Expand Down

0 comments on commit be01042

Please sign in to comment.