diff --git a/src/commands/mod/mute.ts b/src/commands/mod/mute.ts
index 854f38f..ef0a7db 100644
--- a/src/commands/mod/mute.ts
+++ b/src/commands/mod/mute.ts
@@ -91,7 +91,7 @@
         ], ephemeral: true, fetchReply: true})
         let component;
         try {
-            component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 2.5 * 60 * 1000});
+            component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
         } catch { return }
         component.deferUpdate();
         if (component.customId == "cancel") return interaction.editReply({embeds: [new generateEmojiEmbed()
diff --git a/src/commands/mod/purge.ts b/src/commands/mod/purge.ts
index 8e6762e..c6a44b3 100644
--- a/src/commands/mod/purge.ts
+++ b/src/commands/mod/purge.ts
@@ -99,7 +99,7 @@
             })
             let component;
             try {
-                component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 2.5 * 60 * 1000});
+                component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
             } catch (e) { break; }
             component.deferUpdate();
             if (component.customId === "done") break;
@@ -177,7 +177,7 @@
         ])]})
         let component;
         try {
-            component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 2.5 * 60 * 1000});
+            component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
         } catch {}
         if (component && component.customId === "download") {
             interaction.editReply({embeds: [new generateEmojiEmbed()
@@ -276,7 +276,7 @@
             ])]})
             let component;
             try {
-                component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 2.5 * 60 * 1000});
+                component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
             } catch {}
             if (component && component.customId === "download") {
                 interaction.editReply({embeds: [new generateEmojiEmbed()
diff --git a/src/commands/mod/unban.ts b/src/commands/mod/unban.ts
index f201142..f7bf74f 100644
--- a/src/commands/mod/unban.ts
+++ b/src/commands/mod/unban.ts
@@ -11,7 +11,7 @@
     .setDescription("Unbans a user")
     .addStringOption(option => option.setName("user").setDescription("The user to unban (Username or ID)").setRequired(true))
 
-const callback = async (interaction: CommandInteraction) => { // TODO: User search UI
+const callback = async (interaction: CommandInteraction) => {
     let bans = await interaction.guild.bans.fetch()
     let user = interaction.options.getString("user")
     let resolved = bans.find(ban => ban.user.id == user)
diff --git a/src/commands/mod/viewas.ts b/src/commands/mod/viewas.ts
index 5f7c7de..705c04a 100644
--- a/src/commands/mod/viewas.ts
+++ b/src/commands/mod/viewas.ts
@@ -1,6 +1,8 @@
-import { CategoryChannel, CommandInteraction } from "discord.js";
+import Discord, { CategoryChannel, CommandInteraction } from "discord.js";
 import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import { WrappedCheck } from "jshaiku";
+import getEmojiByName from "../../utils/getEmojiByName.js";
 
 const command = (builder: SlashCommandSubcommandBuilder) =>
     builder
@@ -8,11 +10,47 @@
     .setDescription("View the server as a specific member")
     .addUserOption(option => option.setName("member").setDescription("The member to view as").setRequired(true))
 
-const callback = (interaction: CommandInteraction) => {
-    let channels = interaction.guild.channels.cache
+const callback = async (interaction: CommandInteraction) => {
+    let channels = []
+    interaction.guild.channels.cache.forEach(channel => {
+        if (!channel.parent && channel.type !== "GUILD_CATEGORY") channels.push(channel)
+    })
+    channels = [channels]
+    channels = channels.concat(interaction.guild.channels.cache
         .filter(c => c.type === "GUILD_CATEGORY")
         .map(c => (c as CategoryChannel).children.map(c => c))
-    console.log(channels)
+    )
+    let autoSortBelow = ["GUILD_VOICE", "GUILD_STAGE_VOICE"]
+    channels = channels.map(c => c.sort((a, b) => {
+        if (autoSortBelow.includes(a.type) && autoSortBelow.includes(b.type)) return a.name.localeCompare(b.name)
+        if (autoSortBelow.includes(a.type)) return -1
+        if (autoSortBelow.includes(b.type)) return 1
+        return a.position - b.position
+    }))
+    let member = interaction.options.getMember("member") as Discord.GuildMember
+    await interaction.reply({embeds: [new generateEmojiEmbed()
+        .setEmoji("MEMBER.JOIN")
+        .setTitle("Viewing as " + member.displayName)
+        .setStatus("Success")
+    ], ephemeral: true})
+    let page = 0;
+    while (true) {
+        await interaction.editReply({embeds: [new generateEmojiEmbed()
+            .setEmoji("MEMBER.JOIN")
+            .setTitle("Viewing as " + member.displayName)
+            .setStatus("Success")
+            .setDescription(
+                `${channels[page][0].parent ? channels[page][0].parent.name  : "Uncategorised"}` +
+                "Visible:\n" +
+                channels[page].map(c => {
+                    console.log(c)
+                    return (channels[page] as Discord.GuildChannel).permissionsFor(member).has("VIEW_CHANNEL") ?
+                        `${getEmojiByName("ICONS.CHANNEL." + c.type)} ${c.name}\n` : ""
+                }).join("")
+            )
+        ]})
+        break
+    }
 }
 
 const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
diff --git a/src/commands/mod/warn.ts b/src/commands/mod/warn.ts
index 46e2871..bd4bcff 100644
--- a/src/commands/mod/warn.ts
+++ b/src/commands/mod/warn.ts
@@ -109,7 +109,7 @@
             })
             let component;
             try {
-                component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 2.5 * 60 * 1000});
+                component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
             } catch (e) {
                 return await interaction.editReply({embeds: [new generateEmojiEmbed()
                     .setEmoji(`PUNISH.WARN.GREEN`)
diff --git a/src/commands/settings/logs/channel.ts b/src/commands/settings/logs/channel.ts
index 18ed8d9..448f26a 100644
--- a/src/commands/settings/logs/channel.ts
+++ b/src/commands/settings/logs/channel.ts
@@ -89,7 +89,7 @@
         ])]});
         let i;
         try {
-            i = await m.awaitMessageComponent({time: 600000});
+            i = await m.awaitMessageComponent({time: 300000});
         } catch(e) { break }
         i.deferUpdate()
         if (i.component.customId == "clear") {
diff --git a/src/commands/settings/staff/channel.ts b/src/commands/settings/staff/channel.ts
index 69ace92..354d7f1 100644
--- a/src/commands/settings/staff/channel.ts
+++ b/src/commands/settings/staff/channel.ts
@@ -91,7 +91,7 @@
         ])]});
         let i;
         try {
-            i = await m.awaitMessageComponent({time: 600000});
+            i = await m.awaitMessageComponent({time: 300000});
         } catch(e) { break }
         i.deferUpdate()
         if (i.component.customId == "clear") {
diff --git a/src/commands/settings/tickets.ts b/src/commands/settings/tickets.ts
index aac271e..895d7d7 100644
--- a/src/commands/settings/tickets.ts
+++ b/src/commands/settings/tickets.ts
@@ -200,7 +200,7 @@
         });
         let i;
         try {
-            i = await m.awaitMessageComponent({ time: 600000 });
+            i = await m.awaitMessageComponent({ time: 300000 });
         } catch (e) { break }
         i.deferUpdate()
         if (i.component.customId == "clearCategory") {
@@ -237,7 +237,7 @@
     while (true) {
         if (data.useCustom) {
             let customTypes = data.customTypes;
-            interaction.editReply({
+            await interaction.editReply({
                 embeds: [new generateEmojiEmbed()
                     .setTitle("Tickets > Types")
                     .setDescription(
@@ -298,7 +298,7 @@
                     .setMinValues(1)
                     .setPlaceholder("Select types to use")
             ])
-            interaction.editReply({
+            await interaction.editReply({
                 embeds: [new generateEmojiEmbed()
                     .setTitle("Tickets > Types")
                     .setDescription(
@@ -326,7 +326,7 @@
         }
         let i;
         try {
-            i = await m.awaitMessageComponent({ time: 600000 });
+            i = await m.awaitMessageComponent({ time: 300000 });
         } catch (e) { break }
         if (i.component.customId == "types") {
             i.deferUpdate()
diff --git a/src/commands/settings/verify/role.ts b/src/commands/settings/verify/role.ts
index dc1d4d9..68b4bf9 100644
--- a/src/commands/settings/verify/role.ts
+++ b/src/commands/settings/verify/role.ts
@@ -86,7 +86,7 @@
         ])]});
         let i;
         try {
-            i = await m.awaitMessageComponent({time: 600000});
+            i = await m.awaitMessageComponent({time: 300000});
         } catch(e) { break }
         i.deferUpdate()
         if (i.component.customId == "clear") {
diff --git a/src/commands/tag.ts b/src/commands/tag.ts
index 8d6d8c9..c9739c2 100644
--- a/src/commands/tag.ts
+++ b/src/commands/tag.ts
@@ -8,7 +8,7 @@
     .setDescription("Get and manage the servers tags")
 
 const callback = (interaction: CommandInteraction) => {
-    try { statsChannelAdd(interaction.client, interaction.member); } catch {} // TODO: REMOVE THIS FOR PRODUCTION
+    // try { statsChannelAdd(interaction.client, interaction.member); } catch {} // TODO: REMOVE THIS FOR PRODUCTION
     interaction.reply("This command is not yet finished [tag]");
 }
 
@@ -18,4 +18,4 @@
 
 export { command };
 export { callback };
-export { check };
\ No newline at end of file
+export { check };
diff --git a/src/commands/tags/list.ts b/src/commands/tags/list.ts
index bf234d5..5052a6b 100644
--- a/src/commands/tags/list.ts
+++ b/src/commands/tags/list.ts
@@ -100,7 +100,7 @@
         });
         let i
         try {
-            i = await m.awaitMessageComponent({time: 600000 });
+            i = await m.awaitMessageComponent({time: 300000 });
         } catch (e) { break }
         i.deferUpdate()
         if (i.component.customId == "left") {
diff --git a/src/commands/user/about.ts b/src/commands/user/about.ts
index bdd73c4..b497359 100644
--- a/src/commands/user/about.ts
+++ b/src/commands/user/about.ts
@@ -209,7 +209,7 @@
         })
         let i
         try {
-            i = await m.awaitMessageComponent({time: 600000});
+            i = await m.awaitMessageComponent({time: 300000});
         } catch { breakReason = "Message timed out"; break }
         i.deferUpdate()
         if (i.component.customId == "left") {
diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index f96f718..eea0b7b 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -125,7 +125,7 @@
         ])})
         let component;
         try {
-            component = await (m as Message).awaitMessageComponent({time: 2.5 * 60 * 1000});
+            component = await (m as Message).awaitMessageComponent({time: 300000});
         } catch (e) {
             return
         }
@@ -177,4 +177,5 @@
 
 export { command };
 export { callback };
-export { check };
\ No newline at end of file
+export { check };
+
