Rename serverInfo() abstraction to getServerInfoEmbed()

Consistent with getUserInfoEmbed()
This commit is contained in:
Dragory 2020-08-05 17:40:20 +03:00
parent 1df00d8548
commit 6f30356065
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
2 changed files with 6 additions and 3 deletions

View file

@ -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;

View file

@ -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<UtilityPluginType>, serverId: string): Promise<EmbedOptions> {
export async function getServerInfoEmbed(
pluginData: PluginData<UtilityPluginType>,
serverId: string,
): Promise<EmbedOptions> {
const thisServer = serverId === pluginData.guild.id ? pluginData.guild : null;
const [restGuild, guildPreview] = await Promise.all([
thisServer