mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-11 04:45: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
|
@ -19,7 +19,7 @@ export const EditCmd = postCmd({
|
|||
return;
|
||||
}
|
||||
|
||||
if (savedMessage.user_id !== pluginData.client.user.id) {
|
||||
if (savedMessage.user_id !== pluginData.client.user!.id) {
|
||||
sendErrorMessage(pluginData, msg.channel, "Message wasn't posted by me");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { postCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { Embed } from "eris";
|
||||
|
||||
import { trimLines } from "../../../utils";
|
||||
import { formatContent } from "../util/formatContent";
|
||||
import { parseColor } from "../../../utils/parseColor";
|
||||
|
|
|
@ -2,7 +2,7 @@ import { postCmd } from "../types";
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { actualPostCmd } from "../util/actualPostCmd";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { Embed } from "eris";
|
||||
|
||||
import { isValidEmbed, trimLines } from "../../../utils";
|
||||
import { formatContent } from "../util/formatContent";
|
||||
import { parseColor } from "../../../utils/parseColor";
|
||||
|
|
|
@ -3,7 +3,6 @@ import { sorter } from "../../../utils";
|
|||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { postMessage } from "../util/postMessage";
|
||||
import { TextChannel } from "eris";
|
||||
|
||||
export const ScheduledPostsShowCmd = postCmd({
|
||||
trigger: ["scheduled_posts", "scheduled_posts show"],
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { Message, Channel, TextChannel } from "eris";
|
||||
import { StrictMessageContent, errorMessage, stripObjectToScalars, MINUTES, DBDateFormat } from "../../../utils";
|
||||
import moment from "moment-timezone";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { PostPluginType } from "../types";
|
||||
import { Attachment, Message, MessageContent, TextChannel } from "eris";
|
||||
|
||||
import { downloadFile } from "../../../utils";
|
||||
import fs from "fs";
|
||||
import { formatContent } from "./formatContent";
|
||||
|
|
|
@ -4,7 +4,7 @@ import { logger } from "../../../logger";
|
|||
import { stripObjectToScalars, SECONDS, DBDateFormat } from "../../../utils";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import moment from "moment-timezone";
|
||||
import { TextChannel, User } from "eris";
|
||||
|
||||
import { postMessage } from "./postMessage";
|
||||
|
||||
const SCHEDULED_POST_CHECK_INTERVAL = 5 * SECONDS;
|
||||
|
@ -12,10 +12,10 @@ const SCHEDULED_POST_CHECK_INTERVAL = 5 * SECONDS;
|
|||
export async function scheduledPostLoop(pluginData: GuildPluginData<PostPluginType>) {
|
||||
const duePosts = await pluginData.state.scheduledPosts.getDueScheduledPosts();
|
||||
for (const post of duePosts) {
|
||||
const channel = pluginData.guild.channels.get(post.channel_id);
|
||||
const channel = pluginData.guild.channels.cache.get(post.channel_id);
|
||||
if (channel instanceof TextChannel) {
|
||||
const [username, discriminator] = post.author_name.split("#");
|
||||
const author: Partial<User> = pluginData.client.users.get(post.author_id) || {
|
||||
const author: Partial<User> = pluginData.client.user!.get(post.author_id) || {
|
||||
id: post.author_id,
|
||||
username,
|
||||
discriminator,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue