diff options
| author | 8cy <[email protected]> | 2020-04-13 22:02:27 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-13 22:02:27 -0700 |
| commit | bd32bc296da4ba2e0f4ac6eae63ae193b5f60a50 (patch) | |
| tree | 72c613df10ece9bed5c168f741321f4485ac6eda | |
| parent | Initial commit (diff) | |
| download | dep-core-legacy.tar.xz dep-core-legacy.zip | |
The Startlegacy
| -rw-r--r-- | .gitignore | 6 | ||||
| -rw-r--r-- | Procfile | 1 | ||||
| -rw-r--r-- | app.js | 88 | ||||
| -rw-r--r-- | config.json | 4 | ||||
| -rw-r--r-- | package.json | 23 |
5 files changed, 122 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f3e60f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules/ +package-lock.json +.vscode +.vs +.idea +.eclipse diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..ad01c27 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +worker: node app.js @@ -0,0 +1,88 @@ +const Discord = require('discord.js'); +const client = new Discord.Client(); +const config = require('./config.json'); +const emoji = require('emoji-random'); +const { MessageEmbed } = require('discord.js'); + +client.once('ready', () => { + console.log(`Started bot: ${client.user.tag} (ID: ${client.user.id})\nCurrently running on ${client.guilds.cache.size} server(s).`); + client.user.setActivity('anime | uwu!h', { + type: 'WATCHING' + }); +}); + +client.on('error', console.error); + +client.on('message', async msg => { + const upTime = require('moment'); + require('moment-duration-format'); + const duration = upTime.duration(client.uptime).format(" D [days], H [hrs], m [mins], s [secs]"); + + function prefixCheck() { if (msg.content.startsWith(config.prefix)) return true; } + var msgContent = msg.content.toLowerCase(); + if (prefixCheck()) { + if (msg.channel.type == 'dm') { + console.log(msg.author.tag, 'says', msgContent, 'in a DM'); + } else { + console.log(msg.member.user.tag, 'says', msgContent, 'in #' + msg.channel.name + ' in ' + msg.guild.name); + } + + var args = msg.content.slice(config.prefix.length).split(/ +/); + var cmd = args.shift().toLowerCase(); + } + + if (cmd == 'ping' || cmd == 'ms') { + const t = Date.now(); + + msg.channel.send('plz wait..').then(m => { + m.edit(`** **`); + + const n = Date.now(); + + let emb = new MessageEmbed() + .setDescription(`pong! uwufier's ping is \`${n - t}ms\`. heartbeat \`${client.ws.ping}ms\`. ` + emoji.random()) + .setColor(0xFFCC4D) + .setFooter('Bot developed and administrated by sin#1337.'); + + msg.channel.send(emb); + }); + } + + else if (cmd == 'help' || cmd == 'h') { + let embed = new MessageEmbed() + .setColor(0xFFCC4D) + .setTitle('uwufier - Help') + .addField('Normal Commands', '**uwu!ping** - Grabs the bot\'s current ping to server.\n**uwu!uwufy/uwu/owofy/owo** - uwufys anything you send\n**uwu!uptime/ut** - Grabs the bot\'s uptime.') + .addField('Additional Information', 'If you noticied any issues or have any ideas with/ for the bot, don\'t hesitiate to DM me on Discord @ <@217348698294714370>.\nIf you want to become a collaborator, you can also send me a DM via my Discord.') + .setFooter('Bot developed and administrated by sin#1337.'); + msg.channel.send(embed); + } + + else if (cmd == 'uwufy' || cmd == 'uwu' || cmd == 'owofy' || cmd == 'owo') { + var m = args.join(' '); + var u1 = m.replace('r', 'w'); + var u2 = u1.replace('l', 'w'); + msg.reply(u2); + msg.delete(); + } + + else if(cmd == 'uptime' || cmd == 'ut') { + msg.channel.send('plz wait..').then(m => { + m.edit(`** **`); + + let emb = new MessageEmbed() + .setDescription('uwufier\'s uptime is ' + duration + '. ' + emoji.random()) + .setColor(0xFFCC4D) + .setFooter('Bot developed and administrated by sin#1337.'); + + msg.channel.send(emb); + }); + } + + else if (prefixCheck()) { + msg.reply('sowwy... :point_right: :point_left: :flushed: ... but thats not actually a command...'); + msg.channel.send('if u want to see the commands that work, then do `uwu!h` ' + emoji.random()); + } +}); + +client.login(config['secret']);
\ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..6660084 --- /dev/null +++ b/config.json @@ -0,0 +1,4 @@ +{ + "secret":"Njk5NDczMjYzOTk4MjcxNDg5.XpU5oQ.btZuxVudhNllSQY6CxrXXtMJm9A", + "prefix":"uwu!" +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..444e388 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "package", + "version": "1.0.0", + "description": "", + "main": "app.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "sin", + "license": "MIT", + "dependencies": { + "@discordjs/opus": "^0.1.0", + "at-quotes": "^1.3.3", + "demojijs": "^1.2.0", + "discord.js": "^12.1.1", + "emoji-random": "^0.1.2", + "ffmpeg-static": "^4.0.1", + "is-image-url": "^1.1.8", + "moment": "^2.24.0", + "moment-duration-format": "^2.3.2", + "ytdl-core": "^2.0.1" + } +} |