See here for the original README.md
node-link / minecord について、破壊的変更を加えつつ TypeScript で記述しなおしたものです。
type Config = {
pluginsDir: string | null
enable: string[]
disable: string[]
minecraftLog: string
minecraftRconHost: string
minecraftRconPort: number
minecraftRconPassword: string
discordBotToken: string
discordChannel: string
encode: string
}
type Config = {
language: 'en' | 'ja'
pluginList: string[]
pluginDir: string
dictionaryList: string[]
dictionaryDir: string
minecraftLog: string
minecraftRconHost: string
minecraftRconPort: number
minecraftRconPassword: string
discordBotToken: string
discordChannel: string
encode: string
}
language
: 出力時に使用する言語を指定しますpluginsDir
->pluginDir
enable
->pluginList
disable
-> 削除しましたdictionaryList
: 使用する辞書ファイルを指定しますdictionaryDir
: 外部ディレクトリに存在する辞書ファイルを参照するとき、その外部ディレクトリを指定します
import Rcon from 'modern-rcon'
import { Client, Message } from 'discord.js'
type DiscordArgs = {
message: Message
channel: Message['channel']
user: Client['user']
sendDiscord: (
...args: Parameters<Message['channel']['send']>
) => Promise<Message>
sendMinecraft: (
...args: Parameters<Rcon['send']>
) => ReturnType<Rcon['send']>
}
import Rcon from 'rcon-ts'
import { Client, Message } from 'discord.js'
type DiscordArgs = {
message: Message
user: Client['user']
sendDiscord: (
...args: Parameters<Message['channel']['send']>
) => Promise<Message>
sendMinecraft: (
...args: Parameters<Rcon['send']>
) => ReturnType<Rcon['send']>
}
channel
->message.channel
import Rcon from 'modern-rcon'
import { Client, Message } from 'discord.js'
type MinecraftArgs = {
log : string
time: string
causedAt: string
level: string
message: string
channel: Message['channel']
user: Client['user']
sendDiscord: (
...args: Parameters<Message['channel']['send']>
) => Promise<Message>
sendMinecraft: (
...args: Parameters<Rcon['send']>
) => ReturnType<Rcon['send']>
}
import Rcon from 'rcon-ts'
import { Client, Message } from 'discord.js'
type MinecraftArgs = {
logLine: MinecraftLogLine
channel: Message['channel']
user: Client['user']
sendDiscord: (
...args: Parameters<Message['channel']['send']>
) => Promise<Message>
sendMinecraft: (
...args: Parameters<Rcon['send']>
) => ReturnType<Rcon['send']>
}
log
->logLine.log
time
->logLine.time
causedAt
->logLine.causedAt
level
->logLine.level
message
->logLine.message