3
0
Fork 0
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:
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,7 +5,6 @@ import { renderTemplate } from "../../../templateFormatter";
import { resolveMember } from "../../../utils";
import { ActionError } from "../ActionError";
import { canActOn } from "../../../pluginUtils";
import { Message } from "eris";
export const AddRoleAction = t.type({
type: t.literal("add_role"),

View file

@ -18,7 +18,7 @@ export async function makeRoleMentionableAction(
event: TCustomEvent,
eventData: any,
) {
const role = pluginData.guild.roles.get(action.role);
const role = pluginData.guild.roles.cache.get(action.role);
if (!role) {
throw new ActionError(`Unknown role: ${role}`);
}

View file

@ -16,7 +16,7 @@ export async function makeRoleUnmentionableAction(
event: TCustomEvent,
eventData: any,
) {
const role = pluginData.guild.roles.get(action.role);
const role = pluginData.guild.roles.cache.get(action.role);
if (!role) {
throw new ActionError(`Unknown role: ${role}`);
}

View file

@ -3,7 +3,6 @@ import { CustomEventsPluginType } from "../types";
import * as t from "io-ts";
import { renderTemplate } from "../../../templateFormatter";
import { ActionError } from "../ActionError";
import { TextChannel } from "eris";
export const MessageAction = t.type({
type: t.literal("message"),
@ -18,7 +17,7 @@ export async function messageAction(
values: any,
) {
const targetChannelId = await renderTemplate(action.channel, values, false);
const targetChannel = pluginData.guild.channels.get(targetChannelId);
const targetChannel = pluginData.guild.channels.cache.get(targetChannelId);
if (!targetChannel) throw new ActionError("Unknown target channel");
if (!(targetChannel instanceof TextChannel)) throw new ActionError("Target channel is not a text channel");

View file

@ -5,7 +5,6 @@ import { renderTemplate } from "../../../templateFormatter";
import { resolveMember } from "../../../utils";
import { ActionError } from "../ActionError";
import { canActOn } from "../../../pluginUtils";
import { Message, VoiceChannel } from "eris";
export const MoveToVoiceChannelAction = t.type({
type: t.literal("move_to_vc"),
@ -30,7 +29,7 @@ export async function moveToVoiceChannelAction(
}
const targetChannelId = await renderTemplate(action.channel, values, false);
const targetChannel = pluginData.guild.channels.get(targetChannelId);
const targetChannel = pluginData.guild.channels.cache.get(targetChannelId);
if (!targetChannel) throw new ActionError("Unknown target channel");
if (!(targetChannel instanceof VoiceChannel)) throw new ActionError("Target channel is not a voice channel");

View file

@ -24,7 +24,7 @@ export async function setChannelPermissionOverridesAction(
event: TCustomEvent,
eventData: any,
) {
const channel = pluginData.guild.channels.get(action.channel);
const channel = pluginData.guild.channels.cache.get(action.channel);
if (!channel) {
throw new ActionError(`Unknown channel: ${action.channel}`);
}

View file

@ -2,7 +2,7 @@ import { GuildPluginData } from "knub";
import { CustomEventsPluginType, TCustomEvent } from "../types";
import { sendErrorMessage } from "../../../pluginUtils";
import { ActionError } from "../ActionError";
import { Message } from "eris";
import { addRoleAction } from "../actions/addRoleAction";
import { createCaseAction } from "../actions/createCaseAction";
import { moveToVoiceChannelAction } from "../actions/moveToVoiceChannelAction";