mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-13 13:25:03 +00:00
Add typings, comment magic numbers
This commit is contained in:
parent
99c8dbabb7
commit
9a5e911cf2
5 changed files with 18 additions and 5 deletions
|
@ -1,8 +1,12 @@
|
|||
import { ContextMenuInteraction } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { UtilityPlugin } from "../../../plugins/Utility/UtilityPlugin";
|
||||
import { ContextMenuPluginType } from "../types";
|
||||
|
||||
export async function userInfoAction(pluginData: GuildPluginData<ContextMenuPluginType>, interaction) {
|
||||
export async function userInfoAction(
|
||||
pluginData: GuildPluginData<ContextMenuPluginType>,
|
||||
interaction: ContextMenuInteraction,
|
||||
) {
|
||||
interaction.deferReply({ ephemeral: true });
|
||||
const executingMember = await pluginData.guild.members.fetch(interaction.user.id);
|
||||
const userCfg = await pluginData.config.getMatchingConfig({
|
||||
|
@ -13,6 +17,10 @@ export async function userInfoAction(pluginData: GuildPluginData<ContextMenuPlug
|
|||
|
||||
if (userCfg.can_use && (await utility.hasPermission(executingMember, interaction.channelId, "can_userinfo"))) {
|
||||
const embed = await utility.userInfo(interaction.targetId, interaction.user.id);
|
||||
if (!embed) {
|
||||
await interaction.followUp({ content: "Cannot info: internal error" });
|
||||
return;
|
||||
}
|
||||
await interaction.followUp({ embeds: [embed] });
|
||||
} else {
|
||||
await interaction.followUp({ content: "Cannot info: insufficient permissions" });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue