Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let config = require('discord.js'); // on charge le token depuis le fichier config.json
- const fs = require('fs'); // pour lire dans les fichiers
- const Discord = require('discord.js');
- const client = new Discord.Client();
- //////////////////////////////////////////////////
- // les fonctions nécésaires
- async function isMailCorrupted(mail) {
- let filehandle = null;
- var contents = fs.readFileSync('accounts.txt', 'utf8');
- let lines = contents.replace('\r', '').split('\n');
- for (let line of lines) {
- if (line != '' && line == mail) {
- return true;
- }
- }
- return false;
- }
- //////////////////////////////////////////////////
- client.on('ready', () => {
- console.log(`Logged in as ${client.user.tag}!`);
- });
- client.on('message', async msg => {
- if (msg.content.startsWith('.search')) {
- let email = msg.content.replace('.search ', '').strip(); // on récupère ce qu'il y a après le .search
- if (isMailCorrupted(mail)) {
- await msg.channel.send('email corrompus!')
- } else {
- await msg.channel.send('email non corrompus')
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement