Max
Max
SIASapphire - Imagine a framework
Created by Max on 9/22/2023 in #sapphire-support
ExpectedValidationError from EmbedBuilder().setTimestamp(variable)
(using typescript) while creating an embed in an interaction handler and setting the Timestamp on it, the following Error(s) are thrown
CombinedError (3)
Received one or more errors

1 ExpectedValidationError > s.literal(V)
| Expected values to be equals
|
| Expected:
| | null
|
| Received:
| | '1695404406973'

2 ValidationError > s.number
| Expected a number primitive
|
| Received:
| | '1695404406973'

3 ValidationError > s.date
| Expected a Date
|
| Received:
| | '1695404406973'
CombinedError (3)
Received one or more errors

1 ExpectedValidationError > s.literal(V)
| Expected values to be equals
|
| Expected:
| | null
|
| Received:
| | '1695404406973'

2 ValidationError > s.number
| Expected a number primitive
|
| Received:
| | '1695404406973'

3 ValidationError > s.date
| Expected a Date
|
| Received:
| | '1695404406973'
the code throwing is equivalent to the following:
export class someClass {
public createdAt!: number
}

//...

const embed = new EmbedBuilder()
//set a bold title
.setTitle('**EmbedTitle**')
.setDescription('SomeLongText')
.setFooter({ text: 'FooterText' })
.setTimestamp(classInstance.createdAt)
export class someClass {
public createdAt!: number
}

//...

const embed = new EmbedBuilder()
//set a bold title
.setTitle('**EmbedTitle**')
.setDescription('SomeLongText')
.setFooter({ text: 'FooterText' })
.setTimestamp(classInstance.createdAt)
relevant dependeversions:
discord.js 14.13.0
@sapphire/discord.js-utilities 7.0.2
@sapphire/duration 1.1.0
@sapphire/framework 4.6.0
@sapphire/pieces 3.7.0
@sapphire/utilities 3.13.0
discord.js 14.13.0
@sapphire/discord.js-utilities 7.0.2
@sapphire/duration 1.1.0
@sapphire/framework 4.6.0
@sapphire/pieces 3.7.0
@sapphire/utilities 3.13.0
the indirectly depended version of shapeshift throwing the error seems to be @sapphire/[email protected]
10 replies