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

@ -5,14 +5,14 @@ import { availableActions } from "../actions/availableActions";
import { AutomodTriggerMatchResult } from "../helpers";
import { CleanAction } from "../actions/clean";
import { checkAndUpdateCooldown } from "./checkAndUpdateCooldown";
import { TextChannel } from "eris";
import { TextChannel } from "discord.js";
export async function runAutomod(pluginData: GuildPluginData<AutomodPluginType>, context: AutomodContext) {
const userId = context.user?.id || context.member?.id || context.message?.user_id;
const user = context.user || (userId && pluginData.client.users.get(userId));
const member = context.member || (userId && pluginData.guild.members.get(userId)) || null;
const user = context.user || (userId && pluginData.client.users!.cache.get(userId));
const member = context.member || (userId && pluginData.guild.members.cache.get(userId)) || null;
const channelId = context.message?.channel_id;
const channel = channelId ? (pluginData.guild.channels.get(channelId) as TextChannel) : null;
const channel = channelId ? (pluginData.guild.channels.cache.get(channelId) as TextChannel) : null;
const categoryId = channel?.parentID;
const config = await pluginData.config.getMatchingConfig({