3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-24 18:15: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 92cf7f31f9
commit 3883b5b749
181 changed files with 352 additions and 343 deletions

View file

@ -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,