Fixes for thread channels, voice commands, image handling, and snowflake, update packages

This commit is contained in:
Essem 2022-09-27 14:46:07 -05:00
parent 238f44967b
commit c70f86607f
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
18 changed files with 130 additions and 119 deletions

View file

@ -4,6 +4,7 @@ import { prefixCache, aliases, disabledCache, disabledCmdCache, commands } from
import parseCommand from "../utils/parseCommand.js";
import { clean, cleanMessage } from "../utils/misc.js";
import { upload } from "../utils/tempimages.js";
import { ThreadChannel } from "oceanic.js";
// run when someone sends a message
export default async (client, message) => {
@ -11,7 +12,15 @@ export default async (client, message) => {
if (message.author.bot) return;
// don't run command if bot can't send messages
if (message.guildID && !message.channel.permissionsOf(client.user.id.toString()).has("SEND_MESSAGES")) return;
let permChannel = message.channel;
if (permChannel instanceof ThreadChannel && !permChannel.parent) {
try {
permChannel = await client.rest.channels.get(message.channel.parentID);
} catch {
return;
}
}
if (message.guildID && !permChannel.permissionsOf(client.user.id.toString()).has("SEND_MESSAGES")) return;
let prefixCandidate;
let guildDB;