From a3dde2674a3cfc0568ed74a51ba0948cf5559258 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 2 Jan 2020 14:32:10 -0500 Subject: Service status, updating readme files --- CONTRIBUTING.md | 8 +-- README.md | 5 +- bot_discord.js | 1 + commands/poweroff.js | 1 + package.json | 6 +- test.js | 174 --------------------------------------------------- update_dep.bat | 2 +- 7 files changed, 12 insertions(+), 185 deletions(-) delete mode 100644 test.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 70518ab..576f325 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,11 +1,11 @@ # Contributing to AleeBot If you want to help me make AleeBot you must get NodeJS to make AleeBot work. Include the GPL-3.0 license too and follow the following format when you create a new file: -``` +```js /**************************************** * * [Command/Plugin]: (Command or Plugin) for AleeBot - * Copyright (C) 2018 AleeCorp & (your name here) + * Copyright (C) 2017-2020 Alee Productions & (your name here) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,10 +40,10 @@ exports.help = { # Testing the bot -First get NodeJS then clone this repo then do `npm install` in the AleeBot folder. Now add a file called `tokens.json` then copy and paste this follow code. +First get NodeJS then clone this repo then do `npm install` or `yarn install` in the AleeBot folder. Now add a file called `tokens.json` then copy and paste this follow code. ``` { "abtoken": "token" } ``` -Then get your token from discord and replace `token` with your token and finally run this in linux `./run_linux.sh` or for windows `run_win.bat`. +Then get your token from discord and replace `token` with your token and finally run this in linux `./run_linux.sh` or for windows `run_win.bat` or `npm/yarn start`. diff --git a/README.md b/README.md index 6b1c381..9540889 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@

AleeBot

AleeBot Status Widget - Discord Badge Travis CI Build Status + Discord Badge

AleeBot: A bot that's made for the discord app

-
-

PROJECT ANNOUNCEMENT: WE WILL NO LONGER DEVELOP THIS.

+

Project by Alee Productions


What features does AleeBot have?

diff --git a/bot_discord.js b/bot_discord.js index 5de4685..e0f94a1 100644 --- a/bot_discord.js +++ b/bot_discord.js @@ -210,6 +210,7 @@ client.on('ready', () => { }); }, 200000); client.user.setStatus('online'); + client.channels.find('id', '606602551634296968').send("**AleeBot Status:** AleeBot has started."); rl.prompt(); }); diff --git a/commands/poweroff.js b/commands/poweroff.js index 9011567..f336bed 100644 --- a/commands/poweroff.js +++ b/commands/poweroff.js @@ -19,6 +19,7 @@ * *************************************/ module.exports.run = async (client, message, args) => { if (!['242775871059001344',].includes(message.author.id)) return message.reply('Nope! You need the person who created this bot to use this command.'); + await client.channels.find('id', '606602551634296968').send("**AleeBot Status:** AleeBot is now going offline."); await message.reply(':warning: AleeBot will now exit!'); client.destroy(); process.exit(0); diff --git a/package.json b/package.json index c64ec7f..25c377a 100644 --- a/package.json +++ b/package.json @@ -9,14 +9,14 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/AleeCorp/AleeBot.git" + "url": "git+https://github.com/aleeproductions/AleeBot-JS.git" }, "author": "Alee Productions", "license": "GPL-3.0", "bugs": { - "url": "https://github.com/AleeCorp/AleeBot/issues" + "url": "https://github.com/aleeproductions/AleeBot-JS/issues" }, - "homepage": "https://github.com/AleeCorp/AleeBot#readme", + "homepage": "https://github.com/aleeproductions/AleeBot-JS#readme", "dependencies": { "blessed": "^0.1.81", "colors": "^1.3.0", diff --git a/test.js b/test.js deleted file mode 100644 index 49849f7..0000000 --- a/test.js +++ /dev/null @@ -1,174 +0,0 @@ -/**************************************** - * - * AleeBot: Made for discord servers - * Copyright (C) 2018 AleeCorp - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * *************************************/ -const Discord = require('discord.js'); -const moment = require('moment'); -const readline = require('readline'); -const colors = require('colors'); -const DBL = require("dblapi.js"); -const client = new Discord.Client({ - disableEveryone: true -}); -const settings = require('./storage/settings.json') -const fs = require('fs'); -const db = require('quick.db'); - -const log = message => { - - console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] ${message}`.white); - -}; - -console.log(`AleeBot ${settings.abVersion}: Copyright (C) 2018 AleeCorp`.gray); -console.log('This program comes with ABSOLUTELY NO WARRANTY; for details type `show w\'.'.gray); -console.log ('This is free software, and you are welcome to redistribute it'.gray); -console.log ('under certain conditions; type `show c\' for details.\n'.gray) - -if (process.argv.indexOf("--debug") == -1) { - console.log("Running AleeBot without --debug command line flag. Debug output disabled.\n".yellow); -} else { - console.log('[!] Entering debug mode...'.yellow) - client.on('debug', function(info) { - log(info.gray); - }); - client.on('warn', function(info) { - log(info.red); - }); -} - -client.commands = new Discord.Collection(); -client.aliases = new Discord.Collection(); - -fs.readdir('./commands', (err, files) => { - if (err) console.error(err); - log(`[!] Attempting to load a total of ${files.length} commands into the memory.`.cyan); - files.forEach(file => { - try { - const command = require(`./commands/${file}`); - log(`[!] Attempting to load the command "${command.help.name}".`.cyan); - client.commands.set(command.help.name, command); - command.conf.aliases.forEach(alias => { - client.aliases.set(alias, command.help.name); - log(`[!] Attempting to load "${alias}" as an alias for "${command.help.name}"`.cyan); - }); - } - catch (err) { - log('[X] An error has occured trying to load a command. Here is the error.'.red); - console.log(err.stack); - } - }); - log('[>] Command Loading complete!'.green); - console.log('\n'); -}); - -client.on('ready', () => { - log('[>] AleeBot is now ready!'.green); - log(`[i] Logged in as ${client.user.tag}`.green); - log(`[i] Default Prefix: ${settings.prefix}`.green) - log(`[i] Bot ID: ${client.user.id}`.green); - log(`[i] Token: ${api.abtoken}`.green); - log(`[i] Running version ${settings.abVersion} and in ${client.guilds.size} guilds`.green); - - client.setInterval(function() { - const games = [ - 'AleeBot ' + settings.abVersion + ' | ' + settings.prefix + 'help', - 'Annoying Alee', - 'Coding stuff', - 'Drawing shapes', - 'Fighting AstralMod', - ]; - setInterval(() => { - dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total); - }, 1800000); - db.createWebview('password', 3000); - client.user.setPresence({ - status: 'online', - afk: false, - game: { - type: 0, - name: games[Math.floor(Math.random() * games.length)], - }, - }); - }, 200000); - client.user.setStatus('online'); -}); - -client.on('guildCreate', guild => { - - log(`[i] New guild joined: ${guild.name} (id: ${guild.id}). This guild has ${guild.memberCount} members!`.blue); - -}); - - -client.on('guildDelete', guild => { - - log(`[i] I have been removed from: ${guild.name} (id: ${guild.id})`.red); - -}); - - -client.on('message', (msg) => { - if (msg.author.bot) return; - - let prefixes = JSON.parse(fs.readFileSync("./storage/prefixes.json", "utf8")); - - if(!prefixes[msg.guild.id]){ - prefixes[msg.guild.id] = { - prefixes: settings.prefix - }; - } - - let prefix = prefixes[msg.guild.id].prefixes - - - if (!msg.content.startsWith(prefix)) return; - const args = msg.content.slice(prefix.length).trim().split(/ +/g); - const command = args.shift(); - let cmd; - - if (client.commands.has(command)) { - cmd = client.commands.get(command); - } else if (client.aliases.has(command)) { - cmd = client.commands.get(client.aliases.get(command)); - } - - if (cmd) { - if (cmd.conf.guildOnly == true) { - if (!msg.channel.guild) { - return msg.channel.createMessage('This command can only be ran in a guild.'); - } - } - try { - cmd.run(client, msg, args); - } - catch (e) { - console.error(e); - } - } -}); - -process.on('unhandledRejection', function(err, p) { - -log("[X | UNCAUGHT PROMISE] " + err.stack.red); - -}); - -process.on('uncaughtException', function (exception) { - log(exception.red); -}); diff --git a/update_dep.bat b/update_dep.bat index 26c9f44..a90f20d 100644 --- a/update_dep.bat +++ b/update_dep.bat @@ -1,6 +1,6 @@ @echo off title Installing/Updating Dependencies git pull -npm install --save +yarn install pause exit -- cgit v1.2.3