Skip to content

Commit

Permalink
Merge pull request #30 from pattyjogal/CYP-28
Browse files Browse the repository at this point in the history
Fix vote transition role pings
  • Loading branch information
JoshSanch authored Oct 2, 2021
2 parents b7d60f0 + b902730 commit acc1a65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/commands/tenmans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@ class VoteQueueButtonAction extends VoteQueueAction<ButtonInteraction> {
const queueChannel = botConfig.queueMsgChannel as TextChannel;

// Verify that a pingable role exists for 10 mans on this server
const roleId = await this.interaction.guild.roles
const tenmansRole = await this.interaction.guild.roles
.fetch()
.then((roles: Collection<string, Role>) => {
for (const role of roles.values()) {
if (role.name === "10 Mans") {
return role.id;
return role;
}
}
})
.catch(console.error);

if (!roleId) {
if (!tenmansRole) {
this.interaction.reply({
content:
"My camera is destroyed - cannot find a 10 mans role on this server. Message an admin.",
Expand Down Expand Up @@ -195,7 +195,7 @@ class VoteQueueButtonAction extends VoteQueueAction<ButtonInteraction> {
});

await queueChannel.send({
content: `<@${roleId}> that Radianite must be ours! A queue has been created!`,
content: `<@&${tenmansRole.id}> that Radianite must be ours! A queue has been created!`,
});
} catch (e) {
console.error(e);
Expand Down

0 comments on commit acc1a65

Please sign in to comment.