Skip to content

Commit

Permalink
📄 patch page facing up
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivien Mouret committed Jan 26, 2023
1 parent 4bd3a5a commit 877e538
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 26 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# DaftBot


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

## Pré-requis

- Token de votre bot Discord
- Token de votre bot Twitch (optionnel)
- Nodejs et npm

## Utilisation
Expand All @@ -24,3 +27,23 @@ npm install
# Pour lancer le bot
node main.js
```

## Prerequisites

- Token of your Discord bot
- Token of your Twitch bot (optional)
- Nodejs and npm

## Usage

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.

You can then run the following commands:

```bash
# To install the necessary packages
npm install

# To launch the bot
node main.js
```
37 changes: 13 additions & 24 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
'use.strict'

const tmi = require('tmi.js');
const { parse } = require('json2csv');
const fs = require('fs');
const { Discord, Client, Collection, IntentsBitField, ActivityType } = require('discord.js');
const wait = require('util').promisify(setTimeout);

const {
clientId,
identity,
channels
} = require("./twitch_mobbot/config_mobbot.json");
const {
prefix,
token,
owner
} = require("./config_daftbot.json");
const {
fr, en, uk
} = require("./resx/lang.json");
const tmi = require('tmi.js'),
{ parse } = require('json2csv'),
fs = require('fs'),
{ Discord, Client, Collection, IntentsBitField, ActivityType } = require('discord.js'),
wait = require('util').promisify(setTimeout),
{ clientId, identity, channels } = require("./twitch_mobbot/config_mobbot.json"),
{ prefix, token, owner } = require("./config_daftbot.json"),
{ fr, en, uk } = require("./resx/lang.json");

var commandFile = require('./appdata/command.js'),
replyFile = require('./appdata/reply.js'),
Expand Down Expand Up @@ -346,7 +335,7 @@ function setLanguage(message, author, msg, args) {
case 'en':
languageChoosen = en;
message.channel.send(`Language changed to English`);

wait(1000);
daftbot_client.user.setPresence({
activities: [{
Expand All @@ -356,13 +345,13 @@ function setLanguage(message, author, msg, args) {
status: 'online'
});


console.log(`[${getCurrentDatetime('comm')}] ${message.guild.name} / ${message.channel.name} # ${author} : ${msg}`);
return languageChoosen;
case 'uk':
languageChoosen = uk;
message.channel.send(`Мову змінено на українську`);

wait(1000);
daftbot_client.user.setPresence({
activities: [{
Expand All @@ -371,7 +360,7 @@ function setLanguage(message, author, msg, args) {
}],
status: 'online'
});

console.log(`[${getCurrentDatetime('comm')}] ${message.guild.name} / ${message.channel.name} # ${author} : ${msg}`);
return languageChoosen;
default:
Expand Down Expand Up @@ -538,7 +527,7 @@ async function resetBot(message, client, author, msg) {
activities: [{
name: languageChoosen.activities,
type: ActivityType.Watching

}],
status: 'online'
});
Expand Down

0 comments on commit 877e538

Please sign in to comment.