Skip to content

Commit

Permalink
Echo command
Browse files Browse the repository at this point in the history
  • Loading branch information
muricans committed Apr 29, 2019
1 parent 9c0285c commit 2a34e89
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 10 deletions.
8 changes: 7 additions & 1 deletion commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports.registerCommands = function(client) {
client.commands.set(cmd.name, cmd);
}
client.on('message', async message => {
if (message.author.bot) return;
//if (message.author.bot) return;
if (message.channel.type === 'dm') return;
if (message.content.indexOf(settings.prefix) !== 0) return;
const args = message.content.slice(settings.prefix.length).split(' ');
Expand Down Expand Up @@ -75,6 +75,12 @@ module.exports.registerCommands = function(client) {
case "set":
client.commands.get('set').execute(message, args);
break;
case "echo":
client.commands.get('echo').execute(message, args);
break;
/*case "hey": only reason why checking if bot is needed.
message.channel.send('!hey');
break;*/



Expand Down
14 changes: 14 additions & 0 deletions commands/echo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
name: 'echo',
async execute(message, args) {
let hasAdmin = message.channel.permissionsFor(message.member).has("ADMINISTRATOR");
if (!hasAdmin) {
return message.channel.send(message.author + " You don't have permission to use this command!");
}
const echo = args.join(' ');
if (args.length === 0) {
return message.reply('Please add parms! !echo <term>');
}
await message.channel.send(echo);
},
};
2 changes: 1 addition & 1 deletion commands/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
execute(message, args) {
let hasAdmin = message.channel.permissionsFor(message.member).has("ADMINISTRATOR");
if (!hasAdmin) {
return message.channel.send(message.author + " You don't have permission to use this command!")
return message.channel.send(message.author + " You don't have permission to use this command!");
}
if (args.length < 2) {
return message.reply('Please add params! !set <@user> <points>');
Expand Down
16 changes: 10 additions & 6 deletions mbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ client.on('ready', async () => {
});
console.log('mbot v' + package.version + " has been enabled.");
//game
client.user.setPresence({
satus: 'online',
game: {
name: 'Minecraft'
}
});
var games = ['Minecraft', 'Murdering Martine the BOT', 'nymnBridge PewDiePie', 'Acrozze a mega gay', 'This bot was made by me :)'];
setInterval(function() {
var randomStatus = games[Math.floor(Math.random() * games.length)];
client.user.setPresence({
satus: 'online',
game: {
name: randomStatus
}
});
}, 60000);
if (debug) {
try {
let link = await client.generateInvite(["ADMINISTRATOR"]);
Expand Down
4 changes: 2 additions & 2 deletions tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports.setPoints = function(amnt, id) {
}

module.exports.roulette = function(amnt, current, message, client, all) {
const smile = client.emojis.get("572221263435661322");
const smile = client.emojis.get("566861749324873738");
const wtf = client.emojis.get("567905581868777492");
const chance = Math.floor(Math.random() * 100);
var wonall;
Expand Down Expand Up @@ -203,4 +203,4 @@ module.exports.find = async function(list, searchTerm, time, message) {
} catch (err) {
console.log(err);
}
}
}

0 comments on commit 2a34e89

Please sign in to comment.