arg to send cr list in dms

This commit is contained in:
Erik 2023-08-13 20:34:04 +03:00
parent 3c3ea9d90d
commit fd1c4c9b85
Signed by untrusted user: Navy.gif
GPG Key ID: 2532FBBB61C65A68
2 changed files with 114 additions and 112 deletions

View File

@ -8,7 +8,8 @@
"description": "Modmail bot with eventual integration with Galactic Bot's API", "description": "Modmail bot with eventual integration with Galactic Bot's API",
"scripts": { "scripts": {
"start": "node index.js", "start": "node index.js",
"dev": "nodemon --ignore *.json index.js" "dev": "nodemon --ignore *.json index.js",
"dockerpub": "tsc && docker build . --tag navydotgif/modmail:latest && docker push navydotgif/modmail:latest "
}, },
"devDependencies": { "devDependencies": {
"eslint": "^7.28.0", "eslint": "^7.28.0",

View File

@ -13,7 +13,7 @@ class CannedReply extends Command {
async execute (message, { args }) { async execute (message, { args }) {
const [ first ] = args.map((a) => a); const [ first, second ] = args.map((a) => a);
// eslint-disable-next-line prefer-const // eslint-disable-next-line prefer-const
let { channel, content, _caller } = message, let { channel, content, _caller } = message,
anon = false; anon = false;
@ -29,6 +29,7 @@ class CannedReply extends Command {
const list = Object.entries(this.client.modmail.replies); const list = Object.entries(this.client.modmail.replies);
let str = ''; let str = '';
if (second.toLowerCase() === '-dm') channel = await message.author.createDM();
// eslint-disable-next-line no-shadow // eslint-disable-next-line no-shadow
for (const [ name, content ] of list) { for (const [ name, content ] of list) {
const substr = `**${name}:** ${content}\n`; const substr = `**${name}:** ${content}\n`;