mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
More rework progress, remove all eris imports
This commit is contained in:
parent
8f7a6510eb
commit
52839cc9f3
181 changed files with 352 additions and 343 deletions
|
@ -1,7 +1,7 @@
|
|||
import { modActionsEvt } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { Constants, TextChannel } from "eris";
|
||||
|
||||
import { resolveMember } from "../../../utils";
|
||||
import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions";
|
||||
|
||||
|
@ -22,7 +22,7 @@ export const PostAlertOnMemberJoinEvt = modActionsEvt({
|
|||
const logs = pluginData.getPlugin(LogsPlugin);
|
||||
|
||||
if (actions.length) {
|
||||
const alertChannel = pluginData.guild.channels.get(alertChannelId);
|
||||
const alertChannel = pluginData.guild.channels.cache.get(alertChannelId);
|
||||
if (!alertChannel) {
|
||||
logs.log(LogType.BOT_ALERT, {
|
||||
body: `Unknown \`alert_channel\` configured for \`mod_actions\`: \`${alertChannelId}\``,
|
||||
|
@ -37,8 +37,8 @@ export const PostAlertOnMemberJoinEvt = modActionsEvt({
|
|||
return;
|
||||
}
|
||||
|
||||
const botMember = await resolveMember(pluginData.client, pluginData.guild, pluginData.client.user.id);
|
||||
const botPerms = alertChannel.permissionsOf(botMember ?? pluginData.client.user.id);
|
||||
const botMember = await resolveMember(pluginData.client, pluginData.guild, pluginData.client.user!.id);
|
||||
const botPerms = alertChannel.permissionsOf(botMember ?? pluginData.client.user!.id);
|
||||
if (!hasDiscordPermissions(botPerms, Constants.Permissions.sendMessages)) {
|
||||
logs.log(LogType.BOT_ALERT, {
|
||||
body: `Missing "Send Messages" permissions for the \`alert_channel\` configured in \`mod_actions\`: \`${alertChannelId}\``,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue