From 6f30356065ea240cc7526cde445c73825ef41804 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 5 Aug 2020 17:40:20 +0300 Subject: [PATCH] Rename serverInfo() abstraction to getServerInfoEmbed() Consistent with getUserInfoEmbed() --- backend/src/plugins/Utility/commands/ServerCmd.ts | 4 ++-- .../functions/{serverInfo.ts => getServerInfoEmbed.ts} | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) rename backend/src/plugins/Utility/functions/{serverInfo.ts => getServerInfoEmbed.ts} (97%) diff --git a/backend/src/plugins/Utility/commands/ServerCmd.ts b/backend/src/plugins/Utility/commands/ServerCmd.ts index 0cc0e734..adc15062 100644 --- a/backend/src/plugins/Utility/commands/ServerCmd.ts +++ b/backend/src/plugins/Utility/commands/ServerCmd.ts @@ -1,7 +1,7 @@ import { utilityCmd } from "../types"; import { commandTypeHelpers as ct } from "../../../commandTypes"; import { sendErrorMessage } from "../../../pluginUtils"; -import { serverInfo } from "../functions/serverInfo"; +import { getServerInfoEmbed } from "../functions/getServerInfoEmbed"; export const ServerCmd = utilityCmd({ trigger: ["server", "serverinfo"], @@ -15,7 +15,7 @@ export const ServerCmd = utilityCmd({ async run({ message, pluginData, args }) { const serverId = args.serverId || pluginData.guild.id; - const serverInfoEmbed = await serverInfo(pluginData, serverId); + const serverInfoEmbed = await getServerInfoEmbed(pluginData, serverId); if (!serverInfoEmbed) { sendErrorMessage(pluginData, message.channel, "Could not find information for that server"); return; diff --git a/backend/src/plugins/Utility/functions/serverInfo.ts b/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts similarity index 97% rename from backend/src/plugins/Utility/functions/serverInfo.ts rename to backend/src/plugins/Utility/functions/getServerInfoEmbed.ts index f515ae8e..7c0a024e 100644 --- a/backend/src/plugins/Utility/functions/serverInfo.ts +++ b/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts @@ -5,7 +5,10 @@ import { CategoryChannel, EmbedOptions, Guild, RESTChannelInvite, TextChannel, V import moment from "moment-timezone"; import humanizeDuration from "humanize-duration"; -export async function serverInfo(pluginData: PluginData, serverId: string): Promise { +export async function getServerInfoEmbed( + pluginData: PluginData, + serverId: string, +): Promise { const thisServer = serverId === pluginData.guild.id ? pluginData.guild : null; const [restGuild, guildPreview] = await Promise.all([ thisServer