3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-27 11:15:02 +00:00

more minor typings fixes - 23 err left

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
metal 2023-03-12 16:51:26 +00:00 committed by GitHub
parent 69f2f3d516
commit 9956af7c69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 28 additions and 25 deletions

View file

@ -1,6 +1,6 @@
import { Snowflake, SnowflakeUtil } from "discord.js";
export function idToTimestamp(id: string) {
export function idToTimestamp(id: string): string | null {
if (typeof id === "number") return null;
return SnowflakeUtil.deconstruct(id as Snowflake).timestamp;
return SnowflakeUtil.deconstruct(id as Snowflake).timestamp.toString();
}

View file

@ -1,7 +1,7 @@
import {
Emoji,
Guild,
GuildChannel,
GuildBasedChannel,
GuildMember,
Message,
PartialGuildMember,
@ -10,7 +10,6 @@ import {
StageInstance,
Sticker,
StickerFormatType,
ThreadChannel,
User,
} from "discord.js";
import { UnknownUser } from "src/utils";
@ -269,7 +268,7 @@ export function memberToTemplateSafeMember(member: GuildMember | PartialGuildMem
});
}
export function channelToTemplateSafeChannel(channel: GuildChannel | ThreadChannel): TemplateSafeChannel {
export function channelToTemplateSafeChannel(channel: GuildBasedChannel): TemplateSafeChannel {
return new TemplateSafeChannel({
id: channel.id,
name: channel.name,
@ -449,7 +448,7 @@ export function messageToTemplateSafeMessage(message: Message): TemplateSafeMess
id: message.id,
content: message.content,
author: userToTemplateSafeUser(message.author),
channel: channelToTemplateSafeChannel(message.channel as GuildChannel | ThreadChannel),
channel: channelToTemplateSafeChannel(message.channel as GuildBasedChannel),
});
}