|
@@ -3,6 +3,7 @@ import fs from "fs";
|
|
|
import { Message, Client, ClientEvents } from "discord.js";
|
|
|
import { EventType, BotEvent, ICommand, isPlugin, BotEventData, isCustomEvent, IPlugin, CommandType } from "./model/plugin";
|
|
|
import { isAuthorisedAsync } from "./util";
|
|
|
+import { tryDo } from "../../shared/lib/src/common/async_utils";
|
|
|
|
|
|
|
|
|
interface IDocumentationData {
|
|
@@ -128,8 +129,10 @@ export class PluginManager {
|
|
|
}
|
|
|
|
|
|
if (match) {
|
|
|
- if (!c.allowDM && m.channel.type == "dm")
|
|
|
+ if (!c.allowDM && m.channel.type == "dm") {
|
|
|
+ await tryDo(m.reply("Sorry, this command is not available in DMs for now."));
|
|
|
return false;
|
|
|
+ }
|
|
|
if (c.auth && !(await isAuthorisedAsync(m.member)))
|
|
|
return false;
|
|
|
const eventResult = c.action({ message: m, contents: matchData });
|