Closed BlacKlyExactly closed 1 year ago
I haven't tested Reacord extensively with DMs, so there might be an unhandled issue with that flow
I haven't tested Reacord extensively with DMs, so there might be an unhandled issue with that flow
Im gonna try in server text channel
Same error in server text channel If you wish i can push code to the repo
Actually, I think I might see the issue:
const instance = useInstance();
// ...
const handleAcceptClick = async () => {
// ...
instance.render(<Board gameId={gameId} />);
};
While this technically works, useInstance
was made primarily for self-destroying messages, and calling render on this effectively erases itself, which might mess up the instance's data flow.
Try this instead:
const handleAcceptClick = async () => {
// ...
reacord.send(currentChannelId, <Board gameId={gameId} />);
instance.destroy()
};
And you'll probably have to pass currentChannelId
to the component as a prop
I rewrote the function and passed challengedChannelId and senderChannelId as props but still same error
const handleAcceptClick = async () => {
removeInvitation(sender.id, challengedUser.id);
const gameId = addGame(sender, challengedUser);
reacord.send(senderChannelId, <Board gameId={gameId} />);
reacord.send(challengedChannelId, <Board gameId={gameId} />);
instance.destroy();
};
Oof
Yeah, go ahead and upload the repo. I'll look into this later
https://github.com/BlacKlyExactly/tic-tac-toe-bot And thanks for help :)
I reverted some changes from ealier
Alright, I made some renderer fixes in #30 that should resolve this, give it a try 🙂
Now It's working as expected. Thanks for help!
Hi. Im making a tic tac toe discord bot. Im using zustand to manage invitations and game state.
Every time i click any button from Board component i got one of two errors:
(Invitations works as expected and displays board correctly)
Board component
Invitation component
sendDirect function