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
the code throwing is equivalent to the following:
relevant dependeversions:
the indirectly depended version of shapeshift throwing the error seems to be
@sapphire/[email protected]
5 Replies
s.number | Expected a number primitive | | Received: | | '1695404406973'
Solution
classInstance.createdAt
is a stringI know you didnt type it as such but runtime says otherwise
man i hate js sometimes
yup, explicitly casting my number to a number makes sure it's a number
.setTimestamp(Number(classInstance.createdAt))
i assume the single quotes indicate that it's a string in that exception?yeah
also the fact that it says it expected a number but it wasn't, there was only one other thing that could've been formatted like that