ran npm run format

This commit is contained in:
roflmaoqwerty 2020-01-12 22:31:30 +11:00
parent b785efe490
commit c532ab06fb
8 changed files with 56 additions and 24 deletions

View file

@ -163,7 +163,7 @@ connect().then(async conn => {
sendSuccessMessageFn(channel, body) {
const guildId = channel instanceof TextChannel ? channel.guild.id : null;
const emoji = (guildId ? bot.getGuildData(guildId).config.success_emoji : null) ?? 'default emoji here';
const emoji = (guildId ? bot.getGuildData(guildId).config.success_emoji : null) ?? "default emoji here";
channel.createMessage(successMessage(body, emoji));
},

View file

@ -108,7 +108,10 @@ export class MessageSaverPlugin extends ZeppelinPlugin<TConfigSchema> {
const { savedCount, failed } = await this.saveMessagesToDB(args.channel, args.ids);
if (failed.length) {
this.sendSuccessMessage(msg.channel, `Saved ${savedCount} messages. The following messages could not be saved: ${failed.join(", ")}`);
this.sendSuccessMessage(
msg.channel,
`Saved ${savedCount} messages. The following messages could not be saved: ${failed.join(", ")}`,
);
} else {
this.sendSuccessMessage(msg.channel, `Saved ${savedCount} messages!`);
}
@ -126,9 +129,11 @@ export class MessageSaverPlugin extends ZeppelinPlugin<TConfigSchema> {
);
if (failed.length) {
this.sendSuccessMessage(msg.channel, `Saved ${savedCount} messages. The following messages could not be saved: ${failed.join(", ")}`);
}
else {
this.sendSuccessMessage(
msg.channel,
`Saved ${savedCount} messages. The following messages could not be saved: ${failed.join(", ")}`,
);
} else {
this.sendSuccessMessage(msg.channel, `Saved ${savedCount} messages!`);
}
}

View file

@ -624,7 +624,10 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
const messageResultText = warnResult.notifyResult.text ? ` (${warnResult.notifyResult.text})` : "";
this.sendSuccessMessage(msg.channel, `Warned **${memberToWarn.user.username}#${memberToWarn.user.discriminator}** (Case #${warnResult.case.case_number})${messageResultText}`);
this.sendSuccessMessage(
msg.channel,
`Warned **${memberToWarn.user.username}#${memberToWarn.user.discriminator}** (Case #${warnResult.case.case_number})${messageResultText}`,
);
}
async warnMember(
@ -858,14 +861,16 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
// Confirm the action to the moderator
if (args.time) {
const timeUntilUnmute = args.time && humanizeDuration(args.time);
this.sendSuccessMessage(msg.channel,
this.sendSuccessMessage(
msg.channel,
asSingleLine(`
Unmuting **${user.username}#${user.discriminator}**
in ${timeUntilUnmute} (Case #${result.case.case_number})
`),
);
} else {
this.sendSuccessMessage(msg.channel,
this.sendSuccessMessage(
msg.channel,
asSingleLine(`
Unmuted **${user.username}#${user.discriminator}**
(Case #${result.case.case_number})
@ -1152,7 +1157,8 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
});
// Confirm the action to the moderator
this.sendSuccessMessage(msg.channel,
this.sendSuccessMessage(
msg.channel,
`Softbanned **${memberToSoftban.user.username}#${memberToSoftban.user.discriminator}** (Case #${createdCase.case_number})`,
);
@ -1368,7 +1374,8 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
});
if (failedBans.length) {
this.sendSuccessMessage(msg.channel,
this.sendSuccessMessage(
msg.channel,
`Banned ${successfulBanCount} users, ${failedBans.length} failed: ${failedBans.join(" ")}`,
);
} else {
@ -1428,7 +1435,8 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
});
if (user) {
this.sendSuccessMessage(msg.channel,
this.sendSuccessMessage(
msg.channel,
`Case #${theCase.case_number} created for **${user.username}#${user.discriminator}**`,
);
} else {
@ -1593,7 +1601,8 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
}
await this.cases.setHidden(theCase.id, true);
this.sendSuccessMessage(msg.channel,
this.sendSuccessMessage(
msg.channel,
`Case #${theCase.case_number} is now hidden! Use \`unhidecase\` to unhide it.`,
);
}

View file

@ -69,9 +69,7 @@ export class PingableRolesPlugin extends ZeppelinPlugin<TConfigSchema> {
await this.pingableRoles.delete(args.channelId, args.role.id);
this.cache.delete(args.channelId);
this.sendSuccessMessage(msg.channel,
`**${args.role.name}** is no longer set as pingable in <#${args.channelId}>`,
);
this.sendSuccessMessage(msg.channel, `**${args.role.name}** is no longer set as pingable in <#${args.channelId}>`);
}
@d.command("pingable_role", "<channelId:channelId> <role:role>")

View file

@ -147,7 +147,10 @@ export class RemindersPlugin extends ZeppelinPlugin<TConfigSchema> {
const msUntilReminder = reminderTime.diff(now);
const timeUntilReminder = humanizeDuration(msUntilReminder, { largest: 2, round: true });
this.sendSuccessMessage(msg.channel, `I will remind you in **${timeUntilReminder}** at **${reminderTime.format("YYYY-MM-DD, HH:mm")}**`);
this.sendSuccessMessage(
msg.channel,
`I will remind you in **${timeUntilReminder}** at **${reminderTime.format("YYYY-MM-DD, HH:mm")}**`,
);
}
@d.command("reminders")

View file

@ -109,12 +109,16 @@ export class SelfGrantableRolesPlugin extends ZeppelinPlugin<TConfigSchema> {
const removedRolesWord = rolesToRemoveArr.length === 1 ? "role" : "roles";
if (nonMatchingRoleNames.length) {
this.sendSuccessMessage(msg.channel,
this.sendSuccessMessage(
msg.channel,
`<@!${msg.author.id}> Removed ${removedRolesStr.join(", ")} ${removedRolesWord};` +
` couldn't recognize the other roles you mentioned`,
);
} else {
this.sendSuccessMessage(msg.channel, `<@!${msg.author.id}> Removed ${removedRolesStr.join(", ")} ${removedRolesWord}`);
this.sendSuccessMessage(
msg.channel,
`<@!${msg.author.id}> Removed ${removedRolesStr.join(", ")} ${removedRolesWord}`,
);
}
} catch (e) {
this.sendSuccessMessage(msg.channel, `<@!${msg.author.id}> Got an error while trying to remove the roles`);
@ -189,12 +193,16 @@ export class SelfGrantableRolesPlugin extends ZeppelinPlugin<TConfigSchema> {
const grantedRolesWord = rolesToGrantArr.length === 1 ? "role" : "roles";
if (nonMatchingRoleNames.length) {
this.sendSuccessMessage(msg.channel,
this.sendSuccessMessage(
msg.channel,
`<@!${msg.author.id}> Granted you the ${grantedRolesStr.join(", ")} ${grantedRolesWord};` +
` couldn't recognize the other roles you mentioned`,
);
} else {
this.sendSuccessMessage(msg.channel, `<@!${msg.author.id}> Granted you the ${grantedRolesStr.join(", ")} ${grantedRolesWord}`);
this.sendSuccessMessage(
msg.channel,
`<@!${msg.author.id}> Granted you the ${grantedRolesStr.join(", ")} ${grantedRolesWord}`,
);
}
} catch (e) {
msg.channel.createMessage(

View file

@ -194,7 +194,10 @@ export class SlowmodePlugin extends ZeppelinPlugin<TConfigSchema> {
}
if (failedUsers.length) {
this.sendSuccessMessage(msg.channel, `Slowmode disabled! Failed to clear slowmode from the following users:\n\n<@!${failedUsers.join(">\n<@!")}>`);
this.sendSuccessMessage(
msg.channel,
`Slowmode disabled! Failed to clear slowmode from the following users:\n\n<@!${failedUsers.join(">\n<@!")}>`,
);
} else {
this.sendSuccessMessage(msg.channel, "Slowmode disabled!");
initMsg.delete().catch(noop);

View file

@ -770,7 +770,7 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
responseText += ` in <#${targetChannel.id}>\n${cleanResult.archiveUrl}`;
}
responseMsg = await msg.channel.createMessage(successMessage(`<:zep_check:650361014180904971>`,responseText));
responseMsg = await msg.channel.createMessage(successMessage(`<:zep_check:650361014180904971>`, responseText));
} else {
responseMsg = await msg.channel.createMessage(errorMessage(`Found no messages to clean!`));
}
@ -982,7 +982,10 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
return;
}
this.sendSuccessMessage(msg.channel, `Changed nickname of <@!${args.member.id}> from **${oldNickname}** to **${args.nickname}**`);
this.sendSuccessMessage(
msg.channel,
`Changed nickname of <@!${args.member.id}> from **${oldNickname}** to **${args.nickname}**`,
);
}
@d.command("server", "", {
@ -1234,7 +1237,10 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
newChannel: stripObjectToScalars(channel),
});
this.sendSuccessMessage(msg.channel, `**${args.member.user.username}#${args.member.user.discriminator}** moved to **${channel.name}**`);
this.sendSuccessMessage(
msg.channel,
`**${args.member.user.username}#${args.member.user.discriminator}** moved to **${channel.name}**`,
);
}
@d.command("help", "<command:string$>", {