Skip to main content

View Server Info

This command views information about the server. It also includes a subcommand that allows you to view the server icon.

Trigger

Type: Regex
Trigger: \A(-|<@!?204255221017214977>\s*)(server|guild)(-?info)?(\s+|\z)

Usage

  • -serverinfo - Views information about the server.
  • server icon - Views the server icon.
Aliases

Instead of serverinfo, you can also use server, guild, guildinfo, serverinfo, guild-info, or server-info.

Code

{{/*
Views information about the server.
See <https://yagpdb-cc.github.io/info/server> for more information.

Author: jo3-l <https://github.com/jo3-l>
*/}}

{{ $icon := .Guild.IconURL "256" }}
{{ $name := printf "%s (%d)" .Guild.Name .Guild.ID }}

{{ $owner := userArg .Guild.OwnerID }}
{{ $levels := cslice
"None: Unrestricted"
"Low: Must have a verified email on their Discord account."
"Medium: Must also be registered on Discord for longer than 5 minutes."
"(╯°□°)╯︵ ┻━┻: Must also be a member of this server for longer than 10 minutes."
"┻━┻ ミヽ(ಠ益ಠ)ノ彡┻━┻: Must have a verified phone on their Discord account."
}}
{{ $afk := "n/a" }}
{{ if .Guild.AfkChannelID }}
{{ $afk = printf "**Channel:** <#%d> (%d)\n**Timeout:** %s"
.Guild.AfkChannelID
.Guild.AfkChannelID
(mult .Guild.AfkTimeout .TimeSecond | toDuration | humanizeDurationSeconds)
}}
{{ end }}
{{ $embedsEnabled := "No" }}
{{ if .Guild.WidgetEnabled }} {{ $embedsEnabled = "Yes" }} {{ end }}
{{ $createdAt := snowflakeToTime .Guild.ID }}

{{ $infoEmbed := cembed
"author" (sdict "name" $name "icon_url" $icon)
"color" 14232643
"thumbnail" (sdict "url" $icon)
"fields" (cslice
(sdict "name" "❯ Verification Level" "value" (index $levels .Guild.VerificationLevel))
(sdict "name" "❯ Members" "value" (printf "**• Total:** %d Members\n**• Online:** %d Members" .Guild.MemberCount onlineCount))
(sdict "name" "❯ Roles" "value" (printf "**• Total:** %d\nUse `-listroles` to list all roles." (len .Guild.Roles)))
(sdict "name" "❯ Owner" "value" (printf "%s (%d)" $owner.String $owner.ID))
(sdict "name" "❯ AFK" "value" $afk)
(sdict "name" "❯ Embeds Enabled" "value" $embedsEnabled)
)
"footer" (sdict "text" "Created at")
"timestamp" $createdAt
}}

{{ if .CmdArgs }}
{{ if eq (index .CmdArgs 0) "icon" }}
{{ sendMessage nil (cembed
"author" (sdict "name" $name "icon_url" $icon)
"title" "❯ Server Icon"
"color" 14232643
"image" (sdict "url" $icon)
) }}
{{ else }}
{{ sendMessage nil $infoEmbed }}
{{ end }}
{{ else }}
{{ sendMessage nil $infoEmbed }}
{{ end }}

Author

This custom command was written by @jo3-l.