diff --git a/src/api/fish/fishers.ts b/src/api/fish/fishers.ts index 5f4dbd8..fb8358b 100644 --- a/src/api/fish/fishers.ts +++ b/src/api/fish/fishers.ts @@ -66,7 +66,7 @@ export async function tick() { : "massive"; addBack(winner.id, { m: "sendchat", - message: `Our good friend ${user.name} caught a ${size} ${ + message: `Our good friend @${user.id} caught a ${size} ${ animal.emoji || "🐟" }${animal.name}! ready to ${prefixes[0]}eat or ${ prefixes[0] diff --git a/src/mpp/bot/Bot.ts b/src/mpp/bot/Bot.ts index 96deb22..d43d9e1 100644 --- a/src/mpp/bot/Bot.ts +++ b/src/mpp/bot/Bot.ts @@ -145,7 +145,8 @@ export class MPPNetBot { }); if (!command) return; - if (command.response) this.sendChat(command.response, msg.id); + if (command.response) + this.sendDM(command.response, msg.sender._id, msg.id); } ); @@ -202,6 +203,29 @@ export class MPPNetBot { } } } + + public sendDM(text: string, dm: string, reply_to?: string) { + let lines = text.split("\n"); + + for (const line of lines) { + if (line.length <= 510) { + (this.client as any).sendArray([ + { + m: "dm", + message: `\u034f${line + .split("\t") + .join("") + .split("\r") + .join("")}`, + _id: dm, + reply_to: reply_to + } + ]); + } else { + this.sendChat(line); + } + } + } } export default MPPNetBot;