3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-17 23:25:02 +00:00

Thread fixes

This commit is contained in:
Dragory 2021-08-18 20:47:24 +03:00
parent d109a58cb7
commit 0e7cf9715f
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
5 changed files with 18 additions and 11 deletions

View file

@ -1,4 +1,4 @@
import { Client, Intents, TextChannel } from "discord.js";
import { Client, Intents, TextChannel, ThreadChannel } from "discord.js";
import yaml from "js-yaml";
import { Knub, PluginError } from "knub";
import { PluginLoadError } from "knub/dist/plugins/PluginLoadError";
@ -239,13 +239,15 @@ connect().then(async () => {
},
sendSuccessMessageFn(channel, body) {
const guildId = channel instanceof TextChannel ? channel.guild.id : undefined;
const guildId =
channel instanceof TextChannel || channel instanceof ThreadChannel ? channel.guild.id : undefined;
const emoji = guildId ? bot.getLoadedGuild(guildId)!.config.success_emoji : undefined;
channel.send(successMessage(body, emoji));
},
sendErrorMessageFn(channel, body) {
const guildId = channel instanceof TextChannel ? channel.guild.id : undefined;
const guildId =
channel instanceof TextChannel || channel instanceof ThreadChannel ? channel.guild.id : undefined;
const emoji = guildId ? bot.getLoadedGuild(guildId)!.config.error_emoji : undefined;
channel.send(errorMessage(body, emoji));
},