More rework progress, remove all eris imports

This commit is contained in:
Dark 2021-06-01 02:05:55 +02:00
parent 8f7a6510eb
commit 52839cc9f3
No known key found for this signature in database
GPG key ID: 2CD6ACB6B0A87B8A
181 changed files with 352 additions and 343 deletions

View file

@ -1,5 +1,5 @@
import { SavedMessage } from "../../../data/entities/SavedMessage";
import { TextChannel } from "eris";
import { GuildPluginData } from "knub";
import { SlowmodePluginType } from "../types";
import { resolveMember } from "../../../utils";
@ -15,7 +15,7 @@ import { messageLock } from "../../../utils/lockNameHelpers";
export async function onMessageCreate(pluginData: GuildPluginData<SlowmodePluginType>, msg: SavedMessage) {
if (msg.is_bot) return;
const channel = pluginData.guild.channels.get(msg.channel_id) as TextChannel;
const channel = pluginData.guild.channels.cache.get(msg.channel_id) as TextChannel;
if (!channel) return;
// Don't apply slowmode if the lock was interrupted earlier (e.g. the message was caught by word filters)
@ -36,7 +36,7 @@ export async function onMessageCreate(pluginData: GuildPluginData<SlowmodePlugin
if (!isAffected) return thisMsgLock.unlock();
// Make sure we have the appropriate permissions to manage this slowmode
const me = pluginData.guild.members.get(pluginData.client.user.id)!;
const me = pluginData.guild.members.cache.get(pluginData.client.user!.id)!;
const missingPermissions = getMissingChannelPermissions(me, channel, BOT_SLOWMODE_PERMISSIONS);
if (missingPermissions) {
const logs = pluginData.getPlugin(LogsPlugin);