Skip to content
This repository has been archived by the owner on Feb 26, 2018. It is now read-only.

Commit

Permalink
Merge pull request #51 from Perpetucake/master
Browse files Browse the repository at this point in the history
Fixes issue #30: The command prefix should be easily adjustable
  • Loading branch information
Remco authored and Remco committed Dec 4, 2015
2 parents b521cde + 0fd1f1b commit edf9869
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# DougleyBot
[![Version](https://img.shields.io/badge/Version-1.2.9-green.svg?style=flat-square)](https://github.com/SteamingMutt/DougleyBot/releases)
[![Version](https://img.shields.io/badge/Version-1.2.10-green.svg?style=flat-square)](https://github.com/SteamingMutt/DougleyBot/releases)
[![Status](https://img.shields.io/badge/Status-Ready-green.svg?style=flat-square)]()
[![Node](https://img.shields.io/badge/Node-4.2.2-blue.svg?style=flat-square)](http://nodejs.org)
[![NPM](https://img.shields.io/badge/NPM-3.5.0-blue.svg?style=flat-square)](http://nodejs.org)
Expand Down
9 changes: 5 additions & 4 deletions discord_bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var VersionChecker = require("./versioncheck");

var maintenance;

var version = "1.2.9";
var version = "1.2.10";

var Discord = require("discord.js");

Expand All @@ -20,6 +20,8 @@ var youtube_plugin = new yt();
var min = 1;
var max = 671;

var cmdPrefix = '!'

//Allowed send file types for !iff
var ext = [".jpg",".jpeg",".gif",".png"]
var imgDirectory = "./images/"
Expand Down Expand Up @@ -892,10 +894,9 @@ This will check if given message will correspond to a command defined in the com
This will work, so long as the bot isn't overloaded or still busy.
========================
*/

bot.on("message", function (msg) {
// check if message is a command
if(msg.author.id != bot.user.id && (msg.content[0] === '!')){
if(msg.author.id != bot.user.id && (msg.content[0] === cmdPrefix)){
if(msg.author.equals(bot.user)) { return; }
if (maintenance == "true") {
bot.sendMessage(msg.channel, "Hey "+msg.sender + ", I'm in maintenance mode, I can't take commands right now.");
Expand All @@ -909,7 +910,7 @@ bot.on("message", function (msg) {
//help is special since it iterates over the other commands
bot.sendMessage(msg.channel, "Ok "+msg.sender+", I've send you a list of commands via DM.");
for(var cmd in commands) {
var info = "!" + cmd;
var info = cmdPrefix + cmd;
var usage = commands[cmd].usage;
if(usage){
info += " " + usage;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DougleyBot",
"version": "1.2.9",
"version": "1.2.10",
"description": "Bot for Discord app",
"readme": "README.md",
"maintainers": [],
Expand Down

0 comments on commit edf9869

Please sign in to comment.