Skip to content

Commit 877e538

Browse files
author
Vivien Mouret
committed
📄 patch page facing up
1 parent 4bd3a5a commit 877e538

2 files changed

Lines changed: 38 additions & 26 deletions

File tree

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# DaftBot
22

33

4-
![db](https://img.shields.io/badge/daftbot-v1.3.1-red)
4+
![db](https://img.shields.io/badge/daftbot-v1.4.2-red)
55
![npm](https://img.shields.io/npm/v/npm/latest)
6-
![discord.js](https://img.shields.io/badge/discord.js-v12.3.1-green)
6+
![discord.js](https://img.shields.io/badge/discord.js-v14.7.0-green)
7+
![tmi.js](https://img.shields.io/badge/tmi.js-v1.8.5-blue)
8+
![json2csv](https://img.shields.io/badge/json2csv-v6.0.0.alpha.2-orange)
79
![GitHub repo size](https://img.shields.io/github/repo-size/vivimouret29/bot_discord?color=yellow)
810

911
## Pré-requis
1012

1113
- Token de votre bot Discord
14+
- Token de votre bot Twitch (optionnel)
1215
- Nodejs et npm
1316

1417
## Utilisation
@@ -24,3 +27,23 @@ npm install
2427
# Pour lancer le bot
2528
node main.js
2629
```
30+
31+
## Prerequisites
32+
33+
- Token of your Discord bot
34+
- Token of your Twitch bot (optional)
35+
- Nodejs and npm
36+
37+
## Usage
38+
39+
After cloning the repo, simply go to the root of the project and copy the `config.json.example` file to `config.json` and put in your secret discord bot token and the prefix you will use.
40+
41+
You can then run the following commands:
42+
43+
```bash
44+
# To install the necessary packages
45+
npm install
46+
47+
# To launch the bot
48+
node main.js
49+
```

main.js

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11
'use.strict'
22

3-
const tmi = require('tmi.js');
4-
const { parse } = require('json2csv');
5-
const fs = require('fs');
6-
const { Discord, Client, Collection, IntentsBitField, ActivityType } = require('discord.js');
7-
const wait = require('util').promisify(setTimeout);
8-
9-
const {
10-
clientId,
11-
identity,
12-
channels
13-
} = require("./twitch_mobbot/config_mobbot.json");
14-
const {
15-
prefix,
16-
token,
17-
owner
18-
} = require("./config_daftbot.json");
19-
const {
20-
fr, en, uk
21-
} = require("./resx/lang.json");
3+
const tmi = require('tmi.js'),
4+
{ parse } = require('json2csv'),
5+
fs = require('fs'),
6+
{ Discord, Client, Collection, IntentsBitField, ActivityType } = require('discord.js'),
7+
wait = require('util').promisify(setTimeout),
8+
{ clientId, identity, channels } = require("./twitch_mobbot/config_mobbot.json"),
9+
{ prefix, token, owner } = require("./config_daftbot.json"),
10+
{ fr, en, uk } = require("./resx/lang.json");
2211

2312
var commandFile = require('./appdata/command.js'),
2413
replyFile = require('./appdata/reply.js'),
@@ -346,7 +335,7 @@ function setLanguage(message, author, msg, args) {
346335
case 'en':
347336
languageChoosen = en;
348337
message.channel.send(`Language changed to English`);
349-
338+
350339
wait(1000);
351340
daftbot_client.user.setPresence({
352341
activities: [{
@@ -356,13 +345,13 @@ function setLanguage(message, author, msg, args) {
356345
status: 'online'
357346
});
358347

359-
348+
360349
console.log(`[${getCurrentDatetime('comm')}] ${message.guild.name} / ${message.channel.name} # ${author} : ${msg}`);
361350
return languageChoosen;
362351
case 'uk':
363352
languageChoosen = uk;
364353
message.channel.send(`Мову змінено на українську`);
365-
354+
366355
wait(1000);
367356
daftbot_client.user.setPresence({
368357
activities: [{
@@ -371,7 +360,7 @@ function setLanguage(message, author, msg, args) {
371360
}],
372361
status: 'online'
373362
});
374-
363+
375364
console.log(`[${getCurrentDatetime('comm')}] ${message.guild.name} / ${message.channel.name} # ${author} : ${msg}`);
376365
return languageChoosen;
377366
default:
@@ -538,7 +527,7 @@ async function resetBot(message, client, author, msg) {
538527
activities: [{
539528
name: languageChoosen.activities,
540529
type: ActivityType.Watching
541-
530+
542531
}],
543532
status: 'online'
544533
});

0 commit comments

Comments
 (0)