48 lines
952 B
JavaScript
48 lines
952 B
JavaScript
const {
|
|
getPokerService
|
|
} = require("../../utils/crumbPoker");
|
|
|
|
const {
|
|
deferPokerReply,
|
|
editPokerError,
|
|
buildJoinPicker
|
|
} = require("../../utils/pokerDiscord");
|
|
|
|
|
|
module.exports = {
|
|
name:
|
|
"pokerBrowse",
|
|
|
|
async execute(
|
|
interaction
|
|
) {
|
|
await deferPokerReply(
|
|
interaction
|
|
);
|
|
|
|
try {
|
|
const tables =
|
|
await getPokerService()
|
|
.listJoinableTables({
|
|
guildId:
|
|
interaction.guildId,
|
|
channelId:
|
|
interaction.channelId
|
|
});
|
|
|
|
return interaction.editReply(
|
|
buildJoinPicker(
|
|
tables
|
|
)
|
|
);
|
|
}
|
|
|
|
catch (error) {
|
|
return editPokerError(
|
|
interaction,
|
|
error
|
|
);
|
|
}
|
|
}
|
|
};
|