-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* manual verification bug fixes, parser now makes all emails lowercase * fixed undefined type in check-member * notify hacker when ticket deletes due to inactivity * Emergency aaah * Import bug fix, set console logging * DM channel fix, calls creator not property Co-authored-by: Juan Pablo Garcia <45505790+JPGarCar@users.noreply.github.com>
- Loading branch information
Showing
2 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.env | ||
node_modules/ | ||
logs/ | ||
logs/ | ||
docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
const PermissionCommand = require('../../classes/permission-command'); | ||
const { sendEmbedToMember } = require('../../discord-services'); | ||
const { Message, MessageEmbed } = require('discord.js'); | ||
const { messagePrompt } = require('../../classes/prompt'); | ||
const Verification = require('../../classes/verification'); | ||
const BotGuildModel = require('../../classes/bot-guild'); | ||
const Discord = require('discord.js'); | ||
|
||
// Command export | ||
module.exports = class AlternateDM extends PermissionCommand { | ||
constructor(client) { | ||
super(client, { | ||
name: 'alternate-dm', | ||
group: 'verification', | ||
memberName: 'welcome channel verification activation', | ||
description: 'send another dm for verification', | ||
guildOnly: true, | ||
}, | ||
{ | ||
role: PermissionCommand.FLAGS.STAFF_ROLE, | ||
roleMessage: 'Hey there, the !manual-verify command is only for staff!', | ||
}); | ||
} | ||
|
||
/** | ||
* @param {BotGuildModel} botGuild | ||
* @param {Message} message | ||
*/ | ||
async runCommand(botGuild, message) { | ||
var embed = new MessageEmbed() | ||
.setTitle(`If the bot does not respond when you click on the clover emoji in your DM, react to this message with any emoji to verify!`) | ||
let embedMsg = await message.channel.send(embed); | ||
embedMsg.react('🍀'); | ||
|
||
const verifyCollector = embedMsg.createReactionCollector((reaction, user) => !user.bot); | ||
verifyCollector.on('collect', async (reaction, user) => { | ||
let member = message.guild.members.cache.get(user.id); | ||
|
||
try { | ||
var email = (await messagePrompt({prompt: 'Thanks for joining cmd-f 2021! What email did you get accepted with? Please send it now!', channel: (await member.user.createDM()), userId: member.id}, 'string', 45)).content; | ||
} catch (error) { | ||
discordServices.sendEmbedToMember(member, { | ||
title: 'Verification Error', | ||
description: 'Email was not provided, please try again by reacting to the emoji again.!' | ||
}, true); | ||
return; | ||
} | ||
|
||
try { | ||
await Verification.verify(member, email, member.guild, botGuild); | ||
} catch (error) { | ||
discordServices.sendEmbedToMember(member, { | ||
title: 'Verification Error', | ||
description: 'Email provided is not valid! Please try again by reacting to the emoji again.' | ||
}, true); | ||
} | ||
}); | ||
} | ||
} |