3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-16 22:21:51 +00:00

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) { sendSuccessMessageFn(channel, body) {
const guildId = channel instanceof TextChannel ? channel.guild.id : null; 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)); 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); const { savedCount, failed } = await this.saveMessagesToDB(args.channel, args.ids);
if (failed.length) { 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 { } else {
this.sendSuccessMessage(msg.channel, `Saved ${savedCount} messages!`); this.sendSuccessMessage(msg.channel, `Saved ${savedCount} messages!`);
} }
@ -126,9 +129,11 @@ export class MessageSaverPlugin extends ZeppelinPlugin<TConfigSchema> {
); );
if (failed.length) { if (failed.length) {
this.sendSuccessMessage(msg.channel, `Saved ${savedCount} messages. The following messages could not be saved: ${failed.join(", ")}`); this.sendSuccessMessage(
} msg.channel,
else { `Saved ${savedCount} messages. The following messages could not be saved: ${failed.join(", ")}`,
);
} else {
this.sendSuccessMessage(msg.channel, `Saved ${savedCount} messages!`); 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})` : ""; 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( async warnMember(
@ -858,14 +861,16 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
// Confirm the action to the moderator // Confirm the action to the moderator
if (args.time) { if (args.time) {
const timeUntilUnmute = args.time && humanizeDuration(args.time); const timeUntilUnmute = args.time && humanizeDuration(args.time);
this.sendSuccessMessage(msg.channel, this.sendSuccessMessage(
msg.channel,
asSingleLine(` asSingleLine(`
Unmuting **${user.username}#${user.discriminator}** Unmuting **${user.username}#${user.discriminator}**
in ${timeUntilUnmute} (Case #${result.case.case_number}) in ${timeUntilUnmute} (Case #${result.case.case_number})
`), `),
); );
} else { } else {
this.sendSuccessMessage(msg.channel, this.sendSuccessMessage(
msg.channel,
asSingleLine(` asSingleLine(`
Unmuted **${user.username}#${user.discriminator}** Unmuted **${user.username}#${user.discriminator}**
(Case #${result.case.case_number}) (Case #${result.case.case_number})
@ -1152,7 +1157,8 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
}); });
// Confirm the action to the moderator // 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})`, `Softbanned **${memberToSoftban.user.username}#${memberToSoftban.user.discriminator}** (Case #${createdCase.case_number})`,
); );
@ -1368,7 +1374,8 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
}); });
if (failedBans.length) { if (failedBans.length) {
this.sendSuccessMessage(msg.channel, this.sendSuccessMessage(
msg.channel,
`Banned ${successfulBanCount} users, ${failedBans.length} failed: ${failedBans.join(" ")}`, `Banned ${successfulBanCount} users, ${failedBans.length} failed: ${failedBans.join(" ")}`,
); );
} else { } else {
@ -1428,7 +1435,8 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
}); });
if (user) { if (user) {
this.sendSuccessMessage(msg.channel, this.sendSuccessMessage(
msg.channel,
`Case #${theCase.case_number} created for **${user.username}#${user.discriminator}**`, `Case #${theCase.case_number} created for **${user.username}#${user.discriminator}**`,
); );
} else { } else {
@ -1593,7 +1601,8 @@ export class ModActionsPlugin extends ZeppelinPlugin<TConfigSchema> {
} }
await this.cases.setHidden(theCase.id, true); 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.`, `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); await this.pingableRoles.delete(args.channelId, args.role.id);
this.cache.delete(args.channelId); this.cache.delete(args.channelId);
this.sendSuccessMessage(msg.channel, this.sendSuccessMessage(msg.channel, `**${args.role.name}** is no longer set as pingable in <#${args.channelId}>`);
`**${args.role.name}** is no longer set as pingable in <#${args.channelId}>`,
);
} }
@d.command("pingable_role", "<channelId:channelId> <role:role>") @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 msUntilReminder = reminderTime.diff(now);
const timeUntilReminder = humanizeDuration(msUntilReminder, { largest: 2, round: true }); 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") @d.command("reminders")

View file

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

View file

@ -194,7 +194,10 @@ export class SlowmodePlugin extends ZeppelinPlugin<TConfigSchema> {
} }
if (failedUsers.length) { 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 { } else {
this.sendSuccessMessage(msg.channel, "Slowmode disabled!"); this.sendSuccessMessage(msg.channel, "Slowmode disabled!");
initMsg.delete().catch(noop); initMsg.delete().catch(noop);

View file

@ -770,7 +770,7 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
responseText += ` in <#${targetChannel.id}>\n${cleanResult.archiveUrl}`; 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 { } else {
responseMsg = await msg.channel.createMessage(errorMessage(`Found no messages to clean!`)); responseMsg = await msg.channel.createMessage(errorMessage(`Found no messages to clean!`));
} }
@ -982,7 +982,10 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
return; 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", "", { @d.command("server", "", {
@ -1234,7 +1237,10 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
newChannel: stripObjectToScalars(channel), 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$>", { @d.command("help", "<command:string$>", {