mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Reformat all files with Prettier
This commit is contained in:
parent
0cde0d46d2
commit
ac79eb09f5
206 changed files with 727 additions and 888 deletions
|
@ -35,7 +35,7 @@ export const AddDashboardUserCmd = botControlCmd({
|
|||
await pluginData.state.apiPermissionAssignments.addUser(args.guildId, user.id, [ApiPermissions.EditConfig]);
|
||||
}
|
||||
|
||||
const userNameList = args.users.map(user => `<@!${user.id}> (**${user.tag}**, \`${user.id}\`)`);
|
||||
const userNameList = args.users.map((user) => `<@!${user.id}> (**${user.tag}**, \`${user.id}\`)`);
|
||||
sendSuccessMessage(
|
||||
pluginData,
|
||||
msg.channel as TextChannel,
|
||||
|
|
|
@ -52,10 +52,7 @@ export const AddServerFromInviteCmd = botControlCmd({
|
|||
invite.guild.id,
|
||||
msg.author.id,
|
||||
[ApiPermissions.ManageAccess],
|
||||
moment
|
||||
.utc()
|
||||
.add(1, "hour")
|
||||
.format(DBDateFormat),
|
||||
moment.utc().add(1, "hour").format(DBDateFormat),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,10 +48,7 @@ export const AllowServerCmd = botControlCmd({
|
|||
args.guildId,
|
||||
msg.author.id,
|
||||
[ApiPermissions.ManageAccess],
|
||||
moment
|
||||
.utc()
|
||||
.add(1, "hour")
|
||||
.format(DBDateFormat),
|
||||
moment.utc().add(1, "hour").format(DBDateFormat),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ export const ListDashboardUsersCmd = botControlCmd({
|
|||
|
||||
const dashboardUsers = await pluginData.state.apiPermissionAssignments.getByGuildId(guild.id);
|
||||
const users = await Promise.all(
|
||||
dashboardUsers.map(async perm => ({
|
||||
dashboardUsers.map(async (perm) => ({
|
||||
user: await resolveUser(pluginData.client, perm.target_id),
|
||||
permission: perm,
|
||||
})),
|
||||
|
|
|
@ -13,7 +13,7 @@ export const PerformanceCmd = botControlCmd({
|
|||
async run({ pluginData, message: msg, args }) {
|
||||
const stats = pluginData.getKnubInstance().getPluginPerformanceStats();
|
||||
const averageLoadTimeEntries = Object.entries(stats.averageLoadTimes);
|
||||
averageLoadTimeEntries.sort(sorter(v => v[1].time, "DESC"));
|
||||
averageLoadTimeEntries.sort(sorter((v) => v[1].time, "DESC"));
|
||||
const lines = averageLoadTimeEntries.map(
|
||||
([pluginName, { time }]) => `${pluginName}: **${formatNumber(Math.round(time))}ms**`,
|
||||
);
|
||||
|
|
|
@ -34,7 +34,7 @@ export const RemoveDashboardUserCmd = botControlCmd({
|
|||
await pluginData.state.apiPermissionAssignments.removeUser(args.guildId, user.id);
|
||||
}
|
||||
|
||||
const userNameList = args.users.map(user => `<@!${user.id}> (**${user.tag}**, \`${user.id}\`)`);
|
||||
const userNameList = args.users.map((user) => `<@!${user.id}> (**${user.tag}**, \`${user.id}\`)`);
|
||||
sendSuccessMessage(
|
||||
pluginData,
|
||||
msg.channel as TextChannel,
|
||||
|
|
|
@ -22,7 +22,7 @@ export const ServersCmd = botControlCmd({
|
|||
|
||||
async run({ pluginData, message: msg, args }) {
|
||||
const showList = Boolean(args.all || args.initialized || args.uninitialized || args.search);
|
||||
const search = args.search ? new RegExp([...args.search].map(s => escapeStringRegexp(s)).join(".*"), "i") : null;
|
||||
const search = args.search ? new RegExp([...args.search].map((s) => escapeStringRegexp(s)).join(".*"), "i") : null;
|
||||
|
||||
const joinedGuilds = Array.from(pluginData.client.guilds.cache.values());
|
||||
const loadedGuilds = pluginData.getKnubInstance().getLoadedGuilds();
|
||||
|
@ -32,21 +32,21 @@ export const ServersCmd = botControlCmd({
|
|||
let filteredGuilds = Array.from(joinedGuilds);
|
||||
|
||||
if (args.initialized) {
|
||||
filteredGuilds = filteredGuilds.filter(g => loadedGuildsMap.has(g.id));
|
||||
filteredGuilds = filteredGuilds.filter((g) => loadedGuildsMap.has(g.id));
|
||||
}
|
||||
|
||||
if (args.uninitialized) {
|
||||
filteredGuilds = filteredGuilds.filter(g => !loadedGuildsMap.has(g.id));
|
||||
filteredGuilds = filteredGuilds.filter((g) => !loadedGuildsMap.has(g.id));
|
||||
}
|
||||
|
||||
if (args.search) {
|
||||
filteredGuilds = filteredGuilds.filter(g => search!.test(`${g.id} ${g.name}`));
|
||||
filteredGuilds = filteredGuilds.filter((g) => search!.test(`${g.id} ${g.name}`));
|
||||
}
|
||||
|
||||
if (filteredGuilds.length) {
|
||||
filteredGuilds.sort(sorter(g => g.name.toLowerCase()));
|
||||
filteredGuilds.sort(sorter((g) => g.name.toLowerCase()));
|
||||
const longestId = filteredGuilds.reduce((longest, guild) => Math.max(longest, guild.id.length), 0);
|
||||
const lines = filteredGuilds.map(g => {
|
||||
const lines = filteredGuilds.map((g) => {
|
||||
const paddedId = g.id.padEnd(longestId, " ");
|
||||
const owner = getUser(pluginData.client, g.ownerId);
|
||||
return `\`${paddedId}\` **${g.name}** (${g.memberCount} members) (owner **${owner.tag}** \`${owner.id}\`)`;
|
||||
|
@ -57,7 +57,7 @@ export const ServersCmd = botControlCmd({
|
|||
}
|
||||
} else {
|
||||
const total = joinedGuilds.length;
|
||||
const initialized = joinedGuilds.filter(g => loadedGuildsMap.has(g.id)).length;
|
||||
const initialized = joinedGuilds.filter((g) => loadedGuildsMap.has(g.id)).length;
|
||||
const unInitialized = total - initialized;
|
||||
|
||||
msg.channel.send(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue