Conflicting data types with isMessageInstance()
src/commands/ping.ts:18:31 - error TS2345: Argument of type 'APIMessage | Message<boolean>' is not assignable to parameter of type 'Message<boolean> | APIMessage'.
Solution:Jump to solution
Framework does however but I can assure you the code or does are not the issue here otherwise far more people than just you would be having problems.
7 Replies
This could just be me being stilly, but am I forgetting something important
Don't want to hard cast
msg
But I don't see how type X | Y != type Y | X
I ran into this error following the guideam I not?
import { isMessageInstance } from "@sapphire/discord.js-utilities";
this is my only import from anythign other than the frameworkthen use it properly
oh
wait
I misread your message
dedupe your dependencies and make sure you havent installed discord-api-types yourself, or do not install a version newer than 0.33.5
Dependencies seem ok
oh
oh
I see i see
i need to delete /node_modules/
and reinstall
Hmm, still seems to be conflicting
Here's the full error if it helps at all
i haven't manually installed discord-api-types but i deleted
/node_modules/
and ran npm install
and it's still there
Does sapphire djs util install discord-api-types
?@sapphire/discord.js-utilities
Discord.js specific utilities for your JavaScript/TypeScript bots
❯ Author: sapphiredev
❯ Maintainers: favna, kyranet, and vladfrangu
❯ Latest version: 5.1.2
❯ License: MIT
❯ Date Created: <t:1609519287:d>
❯ Date Modified: <t:1670200605:d>
Dependencies:
@sapphire/discord-utilities, @sapphire/duration, @sapphire/utilities, and tslib
Solution
Framework does however but I can assure you the code or does are not the issue here otherwise far more people than just you would be having problems.