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:
parent
69f2f3d516
commit
9956af7c69
15 changed files with 28 additions and 25 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue