added flags and fixed user context menus
diff --git a/src/context/users/flaguser.ts b/src/context/users/flaguser.ts
new file mode 100644
index 0000000..958274f
--- /dev/null
+++ b/src/context/users/flaguser.ts
@@ -0,0 +1,17 @@
+import { ContextMenuCommandBuilder, GuildMember, PermissionFlagsBits, UserContextMenuCommandInteraction } from "discord.js";
+import { noteMenu } from "../../commands/mod/about.js";
+
+const command = new ContextMenuCommandBuilder().setName("Flag User").setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages);
+
+const callback = async (interaction: UserContextMenuCommandInteraction) => {
+ const guild = interaction.guild!;
+ let member = interaction.targetMember as GuildMember | null;
+ if (!member) member = await guild.members.fetch(interaction.targetId);
+ await noteMenu(member, interaction);
+};
+
+const check = async (_interaction: UserContextMenuCommandInteraction) => {
+ return true;
+};
+
+export { command, callback, check };
diff --git a/src/context/users/userinfo.ts b/src/context/users/userinfo.ts
index b215685..e6af836 100644
--- a/src/context/users/userinfo.ts
+++ b/src/context/users/userinfo.ts
@@ -4,13 +4,10 @@
const command = new ContextMenuCommandBuilder().setName("User info");
const callback = async (interaction: UserContextMenuCommandInteraction) => {
- try {
- console.log("getting user info")
- const guild = interaction.guild!;
- let member = interaction.targetMember as GuildMember | null;
- if (!member) member = await guild.members.fetch(interaction.targetId);
- await userAbout(guild, member as GuildMember, interaction);
- } catch (e) { console.log(e) }
+ const guild = interaction.guild!;
+ let member = interaction.targetMember as GuildMember | null;
+ if (!member) member = await guild.members.fetch(interaction.targetId);
+ await userAbout(guild, member as GuildMember, interaction);
};
const check = async (_interaction: UserContextMenuCommandInteraction) => {