Search in sources :

Example 1 with TextualMailResponse

use of com.gamebuster19901.excite.bot.mail.TextualMailResponse in project ExciteBot by TheGameCommunity.

the class Wii method register.

public void register(MessageContext owner) throws SQLException, MessagingException {
    Table.updateWhere(owner, WIIS, DISCORD_ID, owner.getSenderId(), new Comparison(WII_ID, EQUALS, wiiCode.code));
    Table.updateWhere(owner, WIIS, REGISTRATION_CODE, null, new Comparison(WII_ID, EQUALS, wiiCode.code));
    WiiRegistrationAudit.addWiiRegistrationAudit(owner, this, false);
    EmbedBuilder embed = new EmbedBuilder();
    embed.setColor(Color.GREEN);
    embed.setTitle("Registration Successful");
    embed.setDescription("You have succesfully registered the following wii:\n\n" + this.getIdentifierName());
    ElectronicAddress exciteEmail = Mailbox.ADDRESS;
    owner.sendMessage(embed.build());
    LinkedHashSet<MailResponse> wiiMail = Mailbox.packResponses(new TextualMailResponse((Wii) exciteEmail, this, null).setText("This wii has been registered with\n Excitebot.\n" + "registrant: " + owner.getDiscordAuthor().getIdentifierName() + "\n\n" + "If this is not you, contact a TCG\nadmin immediately.\n\n" + "-The Game Community"));
    Mailbox.sendResponses(wiiMail);
}
Also used : EmbedBuilder(net.dv8tion.jda.api.EmbedBuilder) Comparison(com.gamebuster19901.excite.bot.database.Comparison) TextualMailResponse(com.gamebuster19901.excite.bot.mail.TextualMailResponse) ElectronicAddress(com.gamebuster19901.excite.bot.mail.ElectronicAddress) MailResponse(com.gamebuster19901.excite.bot.mail.MailResponse) TextualMailResponse(com.gamebuster19901.excite.bot.mail.TextualMailResponse)

Aggregations

Comparison (com.gamebuster19901.excite.bot.database.Comparison)1 ElectronicAddress (com.gamebuster19901.excite.bot.mail.ElectronicAddress)1 MailResponse (com.gamebuster19901.excite.bot.mail.MailResponse)1 TextualMailResponse (com.gamebuster19901.excite.bot.mail.TextualMailResponse)1 EmbedBuilder (net.dv8tion.jda.api.EmbedBuilder)1