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

Commit

Permalink
Hopefully fixing crashing when using deletion in DM
Browse files Browse the repository at this point in the history
  • Loading branch information
Remco authored and Remco committed Dec 17, 2015
1 parent 1fed851 commit 5670a12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 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.3.3-green.svg?style=flat-square)](https://github.com/SteamingMutt/DougleyBot/releases)
[![Version](https://img.shields.io/badge/Version-1.3.4-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
5 changes: 4 additions & 1 deletion discord_bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ var commands = {
}
if (imgArray.indexOf(suffix) !== -1) {
bot.sendFile(msg.channel, "./images/" + suffix);
if (!msg.channel.server){return;}
var bot_permissions = msg.channel.permissionsOf(bot.user);
if (bot_permissions.hasPermission("manageMessages")) {
bot.deleteMessage(msg);
Expand Down Expand Up @@ -376,7 +377,8 @@ var commands = {
process: function(bot, msg, suffix) {
var bot_permissions = msg.channel.permissionsOf(bot.user);
if (suffix.search("!say") === -1) {
bot.sendMessage(msg.channel, suffix, true);
bot.sendMessage(msg.channel, suffix, true + "-" + msg.author + " " + Date.getFullYear());
if (!msg.channel.server){return;}
if (bot_permissions.hasPermission("manageMessages")) {
bot.deleteMessage(msg);
return;
Expand Down Expand Up @@ -491,6 +493,7 @@ var commands = {
imgflipper.generateMeme(meme[memetype], tags[1] ? tags[1] : "", tags[3] ? tags[3] : "", function(err, image) {
//CmdErrorLog.log("debug", arguments);
bot.sendMessage(msg.channel, image);
if (!msg.channel.server){return;}
var bot_permissions = msg.channel.permissionsOf(bot.user);
if (bot_permissions.hasPermission("manageMessages")) {
bot.deleteMessage(msg);
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.3.3",
"version": "1.3.4",
"description": "Bot for Discord app",
"readme": "README.md",
"maintainers": [],
Expand Down

0 comments on commit 5670a12

Please sign in to comment.