I’m developing a Discord bot for matchmaking in a game, and I’ve hit a snag with implementing a specific feature. The bot is supposed to allow two randomly selected captains to pick players from a pool in a newly created game channel. However, when issuing the !p command to pick a player, nothing happens—no new embed is generated, and the player isn’t moved to a team.
Here’s a simplified overview of how the feature is supposed to work:
1.Two captains are picked randomly when the game channel is created.
2.The first captain uses !p @user to pick a player from the “Remaining players” pool.
3.An embed should update to reflect the picked player moving to Captain A’s team, and it’s then Captain B’s turn.
4.The process repeats, but Captain B picks two players. The last player automatically joins Captain A’s team.
A final embed displays the teams.
here’s an example of the embed structure:
enter image description here
For some reason, when I issue the !p command, it doesn’t trigger the creation of a new embed or modify the team compositions as expected. I’ve ensured that my code is set up to handle the command and modify the embeds, but it’s not working as intended.
You can find my full code here:
I’m not sure why this isn’t working. Has anyone encountered a similar issue or sees something I might be missing in my implementation? Any help would be greatly appreciated.
{
title: 'Game(number) — General Queue V3',
description: 'Start picking!',
fields: [
{ name: 'Team Alpha', value: '@CaptainAn@pickedUser' },
{ name: 'Team Beta', value: '@CaptainB' },
{ name: 'Remaining Players', value: '@user2n@user3n@user4' },
{ name: 'Current Pick', value: '@CaptainB Use the !p command to pick 2 players' }
]
}