feat: Use to discord.js#Message.reply
This commit is contained in:
parent
a57d3d6d69
commit
b5e6e68dee
64 changed files with 907 additions and 27 deletions
BIN
.yarn/cache/@esbuild-linux-x64-npm-0.19.12-59062fdb38-10.zip
vendored
Normal file
BIN
.yarn/cache/@esbuild-linux-x64-npm-0.19.12-59062fdb38-10.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@jridgewell-gen-mapping-npm-0.3.5-d8b85ebeaf-81587b3c4d.zip
vendored
Normal file
BIN
.yarn/cache/@jridgewell-gen-mapping-npm-0.3.5-d8b85ebeaf-81587b3c4d.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@jridgewell-resolve-uri-npm-3.1.2-5bc4245992-97106439d7.zip
vendored
Normal file
BIN
.yarn/cache/@jridgewell-resolve-uri-npm-3.1.2-5bc4245992-97106439d7.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@jridgewell-set-array-npm-1.2.1-2312928209-832e513a85.zip
vendored
Normal file
BIN
.yarn/cache/@jridgewell-set-array-npm-1.2.1-2312928209-832e513a85.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@jridgewell-trace-mapping-npm-0.3.25-c076fd2279-dced32160a.zip
vendored
Normal file
BIN
.yarn/cache/@jridgewell-trace-mapping-npm-0.3.25-c076fd2279-dced32160a.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@npmcli-agent-npm-2.2.2-e2f559d6c0-96fc0036b1.zip
vendored
Normal file
BIN
.yarn/cache/@npmcli-agent-npm-2.2.2-e2f559d6c0-96fc0036b1.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@npmcli-fs-npm-3.1.1-c19bd09f3c-1e0e040870.zip
vendored
Normal file
BIN
.yarn/cache/@npmcli-fs-npm-3.1.1-c19bd09f3c-1e0e040870.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@rollup-rollup-linux-x64-gnu-npm-4.18.0-0aa51442a0-10.zip
vendored
Normal file
BIN
.yarn/cache/@rollup-rollup-linux-x64-gnu-npm-4.18.0-0aa51442a0-10.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@types-estree-npm-1.0.5-5b7faed3b4-7de6d928dd.zip
vendored
Normal file
BIN
.yarn/cache/@types-estree-npm-1.0.5-5b7faed3b4-7de6d928dd.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/abbrev-npm-2.0.0-0eb38a17e5-ca0a54e35b.zip
vendored
Normal file
BIN
.yarn/cache/abbrev-npm-2.0.0-0eb38a17e5-ca0a54e35b.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/agent-base-npm-7.1.1-c9e1a4b59e-c478fec8f7.zip
vendored
Normal file
BIN
.yarn/cache/agent-base-npm-7.1.1-c9e1a4b59e-c478fec8f7.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/binary-extensions-npm-2.3.0-bd3f20d865-bcad01494e.zip
vendored
Normal file
BIN
.yarn/cache/binary-extensions-npm-2.3.0-bd3f20d865-bcad01494e.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/braces-npm-3.0.3-582c14023c-fad11a0d46.zip
vendored
Normal file
BIN
.yarn/cache/braces-npm-3.0.3-582c14023c-fad11a0d46.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/bundle-require-npm-4.1.0-f0b6010bad-9d01d30cf7.zip
vendored
Normal file
BIN
.yarn/cache/bundle-require-npm-4.1.0-f0b6010bad-9d01d30cf7.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/cacache-npm-18.0.3-7936f526c3-d4c161f071.zip
vendored
Normal file
BIN
.yarn/cache/cacache-npm-18.0.3-7936f526c3-d4c161f071.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/chokidar-npm-3.6.0-3c413a828f-c327fb0770.zip
vendored
Normal file
BIN
.yarn/cache/chokidar-npm-3.6.0-3c413a828f-c327fb0770.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/esbuild-npm-0.19.12-fb5a3a4313-861fa8eb24.zip
vendored
Normal file
BIN
.yarn/cache/esbuild-npm-0.19.12-fb5a3a4313-861fa8eb24.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/fast-glob-npm-3.3.2-0a8cb4f2ca-222512e931.zip
vendored
Normal file
BIN
.yarn/cache/fast-glob-npm-3.3.2-0a8cb4f2ca-222512e931.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/fastq-npm-1.17.1-56d4554993-a443180068.zip
vendored
Normal file
BIN
.yarn/cache/fastq-npm-1.17.1-56d4554993-a443180068.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/fill-range-npm-7.1.1-bf491486db-a7095cb39e.zip
vendored
Normal file
BIN
.yarn/cache/fill-range-npm-7.1.1-bf491486db-a7095cb39e.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/glob-npm-10.4.1-a0d030e0a9-d7bb49d2b4.zip
vendored
Normal file
BIN
.yarn/cache/glob-npm-10.4.1-a0d030e0a9-d7bb49d2b4.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/http-proxy-agent-npm-7.0.2-643ed7cc33-d062acfa0c.zip
vendored
Normal file
BIN
.yarn/cache/http-proxy-agent-npm-7.0.2-643ed7cc33-d062acfa0c.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/https-proxy-agent-npm-7.0.4-a51e13f5dc-405fe582bb.zip
vendored
Normal file
BIN
.yarn/cache/https-proxy-agent-npm-7.0.4-a51e13f5dc-405fe582bb.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/ignore-npm-5.3.1-f6947c5df7-0a884c2fbc.zip
vendored
Normal file
BIN
.yarn/cache/ignore-npm-5.3.1-f6947c5df7-0a884c2fbc.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/ip-address-npm-9.0.5-9fa024d42a-1ed81e0672.zip
vendored
Normal file
BIN
.yarn/cache/ip-address-npm-9.0.5-9fa024d42a-1ed81e0672.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/isexe-npm-3.1.1-9c0061eead-7fe1931ee4.zip
vendored
Normal file
BIN
.yarn/cache/isexe-npm-3.1.1-9c0061eead-7fe1931ee4.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/jackspeak-npm-3.1.2-dbb3ed8474-7e6b94103e.zip
vendored
Normal file
BIN
.yarn/cache/jackspeak-npm-3.1.2-dbb3ed8474-7e6b94103e.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/jsbn-npm-1.1.0-1da0181838-bebe7ae829.zip
vendored
Normal file
BIN
.yarn/cache/jsbn-npm-1.1.0-1da0181838-bebe7ae829.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/lilconfig-npm-3.1.1-b8cdeef996-c80fbf98ae.zip
vendored
Normal file
BIN
.yarn/cache/lilconfig-npm-3.1.1-b8cdeef996-c80fbf98ae.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/lru-cache-npm-10.2.2-c54b721fc3-ff1a496d30.zip
vendored
Normal file
BIN
.yarn/cache/lru-cache-npm-10.2.2-c54b721fc3-ff1a496d30.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/make-fetch-happen-npm-13.0.1-4180f2aaa8-11bae5ad6a.zip
vendored
Normal file
BIN
.yarn/cache/make-fetch-happen-npm-13.0.1-4180f2aaa8-11bae5ad6a.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/micromatch-npm-4.0.7-28fb7387ee-a11ed1cb67.zip
vendored
Normal file
BIN
.yarn/cache/micromatch-npm-4.0.7-28fb7387ee-a11ed1cb67.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/minimatch-npm-9.0.4-7be5a33efc-4cdc18d112.zip
vendored
Normal file
BIN
.yarn/cache/minimatch-npm-9.0.4-7be5a33efc-4cdc18d112.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/minipass-collect-npm-2.0.1-73d3907e40-b251bceea6.zip
vendored
Normal file
BIN
.yarn/cache/minipass-collect-npm-2.0.1-73d3907e40-b251bceea6.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/minipass-fetch-npm-3.0.5-ed78529694-c669948bec.zip
vendored
Normal file
BIN
.yarn/cache/minipass-fetch-npm-3.0.5-ed78529694-c669948bec.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/minipass-npm-7.1.2-3a5327d36d-c25f0ee819.zip
vendored
Normal file
BIN
.yarn/cache/minipass-npm-7.1.2-3a5327d36d-c25f0ee819.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/node-gyp-npm-10.1.0-bdea7d2ece-89e105e495.zip
vendored
Normal file
BIN
.yarn/cache/node-gyp-npm-10.1.0-bdea7d2ece-89e105e495.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/nopt-npm-7.2.1-635b7da949-95a1f6dec8.zip
vendored
Normal file
BIN
.yarn/cache/nopt-npm-7.2.1-635b7da949-95a1f6dec8.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/path-scurry-npm-1.11.1-aaf8c339af-5e8845c159.zip
vendored
Normal file
BIN
.yarn/cache/path-scurry-npm-1.11.1-aaf8c339af-5e8845c159.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/postcss-load-config-npm-4.0.2-319bcff9ca-e2c2ed9b79.zip
vendored
Normal file
BIN
.yarn/cache/postcss-load-config-npm-4.0.2-319bcff9ca-e2c2ed9b79.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/proc-log-npm-3.0.0-a8c21c2f0f-02b64e1b39.zip
vendored
Normal file
BIN
.yarn/cache/proc-log-npm-3.0.0-a8c21c2f0f-02b64e1b39.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/proc-log-npm-4.2.0-4d65296a9d-4e1394491b.zip
vendored
Normal file
BIN
.yarn/cache/proc-log-npm-4.2.0-4d65296a9d-4e1394491b.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/punycode-npm-2.3.1-97543c420d-febdc4362b.zip
vendored
Normal file
BIN
.yarn/cache/punycode-npm-2.3.1-97543c420d-febdc4362b.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/rollup-npm-4.18.0-9eadb97a09-2320fe653c.zip
vendored
Normal file
BIN
.yarn/cache/rollup-npm-4.18.0-9eadb97a09-2320fe653c.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/semver-npm-7.6.2-0fec6944bb-296b17d027.zip
vendored
Normal file
BIN
.yarn/cache/semver-npm-7.6.2-0fec6944bb-296b17d027.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/socks-npm-2.8.3-3532b59899-ffcb622c22.zip
vendored
Normal file
BIN
.yarn/cache/socks-npm-2.8.3-3532b59899-ffcb622c22.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/socks-proxy-agent-npm-8.0.3-30471cff1b-c2112c66d6.zip
vendored
Normal file
BIN
.yarn/cache/socks-proxy-agent-npm-8.0.3-30471cff1b-c2112c66d6.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/sprintf-js-npm-1.1.3-b99efd75b2-e7587128c4.zip
vendored
Normal file
BIN
.yarn/cache/sprintf-js-npm-1.1.3-b99efd75b2-e7587128c4.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/ssri-npm-10.0.6-6b8eaec5ce-f92c1b3cc9.zip
vendored
Normal file
BIN
.yarn/cache/ssri-npm-10.0.6-6b8eaec5ce-f92c1b3cc9.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/sucrase-npm-3.35.0-60ad876a0c-bc601558a6.zip
vendored
Normal file
BIN
.yarn/cache/sucrase-npm-3.35.0-60ad876a0c-bc601558a6.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/tar-npm-6.2.1-237800bb20-bfbfbb2861.zip
vendored
Normal file
BIN
.yarn/cache/tar-npm-6.2.1-237800bb20-bfbfbb2861.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/tsup-npm-8.0.2-86e40f68a7-dd8c375181.zip
vendored
Normal file
BIN
.yarn/cache/tsup-npm-8.0.2-86e40f68a7-dd8c375181.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/typescript-npm-5.4.5-8568a42232-d04a9e27e6.zip
vendored
Normal file
BIN
.yarn/cache/typescript-npm-5.4.5-8568a42232-d04a9e27e6.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/typescript-patch-6e159bfddb-760f7d92fb.zip
vendored
Normal file
BIN
.yarn/cache/typescript-patch-6e159bfddb-760f7d92fb.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/which-npm-4.0.0-dd31cd4928-f17e84c042.zip
vendored
Normal file
BIN
.yarn/cache/which-npm-4.0.0-dd31cd4928-f17e84c042.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/yaml-npm-2.4.2-5c2ee7f06c-6eafbcd68d.zip
vendored
Normal file
BIN
.yarn/cache/yaml-npm-2.4.2-5c2ee7f06c-6eafbcd68d.zip
vendored
Normal file
Binary file not shown.
894
.yarn/releases/yarn-4.2.2.cjs
vendored
Executable file
894
.yarn/releases/yarn-4.2.2.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"bot": {
|
"bot": {
|
||||||
"owner_ID": "",
|
"owner_ID": "",
|
||||||
"token": ""
|
"token": "",
|
||||||
|
"prefix": ""
|
||||||
},
|
},
|
||||||
"train": {
|
"train": {
|
||||||
"user_ID": ""
|
"user_ID": ""
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "muffin-ai-arujak",
|
"name": "muffin-ai-arujak",
|
||||||
"version": "2.0.0-oreo.83",
|
"version": "2.0.0-oreo.d240530a",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -5,13 +5,12 @@ import {
|
||||||
GatewayIntentBits,
|
GatewayIntentBits,
|
||||||
TextChannel,
|
TextChannel,
|
||||||
} from 'discord.js'
|
} from 'discord.js'
|
||||||
import { Command, noPerm, ChatBot, NODE_ENV } from './modules'
|
import { type Command, noPerm, ChatBot, NODE_ENV } from './modules'
|
||||||
import { readdirSync } from 'node:fs'
|
import { readdirSync } from 'node:fs'
|
||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import { execSync } from 'node:child_process'
|
|
||||||
import config from '../config.json'
|
import config from '../config.json'
|
||||||
|
|
||||||
const prefix = '멒힌아 '
|
const prefix = config.bot.prefix
|
||||||
|
|
||||||
export default class MuffinAI extends Client {
|
export default class MuffinAI extends Client {
|
||||||
get chatBot() {
|
get chatBot() {
|
||||||
|
@ -37,14 +36,10 @@ export default class MuffinAI extends Client {
|
||||||
const a = require(join(__dirname, 'Commands', file))
|
const a = require(join(__dirname, 'Commands', file))
|
||||||
const b: Command = new a.default()
|
const b: Command = new a.default()
|
||||||
this.#modules.set(b.name, b)
|
this.#modules.set(b.name, b)
|
||||||
if (NODE_ENV === 'development') console.log(b.name)
|
if (NODE_ENV === 'development') console.log(`${b.name}가 로ㄷ드됨`)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.once('ready', client => {
|
this.once('ready', client => {
|
||||||
console.log(
|
|
||||||
`Build Number: ${execSync('git rev-parse --short HEAD').toString()}`,
|
|
||||||
)
|
|
||||||
|
|
||||||
function setStatus() {
|
function setStatus() {
|
||||||
client.user.setActivity({
|
client.user.setActivity({
|
||||||
type: ActivityType.Custom,
|
type: ActivityType.Custom,
|
||||||
|
@ -64,7 +59,7 @@ export default class MuffinAI extends Client {
|
||||||
|
|
||||||
if (NODE_ENV === 'development') console.log(args)
|
if (NODE_ENV === 'development') console.log(args)
|
||||||
if (msg.author.bot) return
|
if (msg.author.bot) return
|
||||||
if (msg.content.startsWith('머핀아 ')) {
|
if (msg.content.startsWith(prefix)) {
|
||||||
if (msg.channel instanceof TextChannel) {
|
if (msg.channel instanceof TextChannel) {
|
||||||
await msg.channel.sendTyping()
|
await msg.channel.sendTyping()
|
||||||
const command = this.#modules.get(args.shift()!.toLowerCase())
|
const command = this.#modules.get(args.shift()!.toLowerCase())
|
||||||
|
@ -73,22 +68,12 @@ export default class MuffinAI extends Client {
|
||||||
if (command.noPerm && msg.author.id !== config.bot.owner_ID)
|
if (command.noPerm && msg.author.id !== config.bot.owner_ID)
|
||||||
return await noPerm(msg)
|
return await noPerm(msg)
|
||||||
|
|
||||||
command.execute(msg, args)
|
await command.execute(msg, args)
|
||||||
} else {
|
} else {
|
||||||
const response = await this.chatBot.getResponse(msg)
|
const response = await this.chatBot.getResponse(msg)
|
||||||
await msg.channel.send(response)
|
await msg.reply(response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (msg.content.startsWith(prefix)) {
|
|
||||||
if (msg.channel instanceof TextChannel) if (msg.channel.nsfw) return
|
|
||||||
await msg.channel.sendTyping()
|
|
||||||
|
|
||||||
const command = this.#modules.get(args.shift()!.toLowerCase())
|
|
||||||
if (!command) return
|
|
||||||
if (command.noPerm && msg.author.id !== config.bot.owner_ID)
|
|
||||||
return await noPerm(msg)
|
|
||||||
|
|
||||||
command.execute(msg, args)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return super.login(config.bot.token)
|
return super.login(config.bot.token)
|
||||||
|
|
|
@ -24,6 +24,6 @@ export default class extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
await db.learn.delete(command)
|
await db.learn.delete(command)
|
||||||
await msg.channel.send('해당 단어를 삭ㄱ제했어요.')
|
await msg.reply('해당 단어를 삭ㄱ제했어요.')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ export default class extends Command {
|
||||||
|
|
||||||
public async execute(msg: Message, args: string[]) {
|
public async execute(msg: Message, args: string[]) {
|
||||||
if (!args[0] || !args[1]) {
|
if (!args[0] || !args[1]) {
|
||||||
return await msg.channel.send(
|
return await msg.reply(
|
||||||
'```\n멒힌아 배워 (등록할 단어) (대답)\n```\n `_`를 대답에 쓰면 공백으로 바뀌ㅇ어요.',
|
'```\n멒힌아 배워 (등록할 단어) (대답)\n```\n `_`를 대답에 쓰면 공백으로 바뀌ㅇ어요.',
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default class extends Command {
|
||||||
if (row.persona === 'muffin') muffin.push(row)
|
if (row.persona === 'muffin') muffin.push(row)
|
||||||
else return
|
else return
|
||||||
})
|
})
|
||||||
msg.channel.send(
|
await msg.reply(
|
||||||
`머핀 데이터: ${muffin.length}개\nnsfw 데이터: ${nsfwData.length}개\n지금까지 배운 단어: ${learnData.length}개`,
|
`머핀 데이터: ${muffin.length}개\nnsfw 데이터: ${nsfwData.length}개\n지금까지 배운 단어: ${learnData.length}개`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default class extends Command {
|
||||||
list.push(listData.command)
|
list.push(listData.command)
|
||||||
}
|
}
|
||||||
|
|
||||||
await msg.channel.send({
|
await msg.reply({
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
title: '지식',
|
title: '지식',
|
||||||
|
|
Loading…
Reference in a new issue