diff --git a/src/commands/nucleus/guide.ts b/src/commands/nucleus/guide.ts
index c95e78c..8c32ef6 100644
--- a/src/commands/nucleus/guide.ts
+++ b/src/commands/nucleus/guide.ts
@@ -6,7 +6,7 @@
     builder.setName("guide").setDescription("Shows the welcome guide for the bot");
 
 const callback = async (interaction: CommandInteraction) => {
-    await guide(interaction.guild!, interaction);
+    await guide(interaction.guild, interaction);
 };
 
 export { command };
diff --git a/src/commands/nucleus/invite.ts b/src/commands/nucleus/invite.ts
index 0307c68..561de03 100644
--- a/src/commands/nucleus/invite.ts
+++ b/src/commands/nucleus/invite.ts
@@ -23,7 +23,7 @@
                     .setURL(
                         `https://discord.com/api/oauth2/authorize?client_id=${
                             client.user!.id
-                        }&permissions=407900777662&scope=bot%20applications.commands`
+                        }&permissions=407900777662&scope=applications.commands`
                     )
             ])
         ],
diff --git a/src/commands/nucleus/suggest.ts b/src/commands/nucleus/suggest.ts
index c1f0312..f6755e2 100644
--- a/src/commands/nucleus/suggest.ts
+++ b/src/commands/nucleus/suggest.ts
@@ -19,7 +19,6 @@
     builder.setName("suggest").setDescription("Sends a suggestion to the developers");
 
 const callback = async (interaction: CommandInteraction): Promise<void> => {
-    await interaction.guild?.members.fetch(interaction.member!.user.id);
     await interaction.reply({ embeds: LoadingEmbed, ephemeral: true });
     let closed = false;
     let suggestionTitle: string | null = null;
@@ -90,18 +89,25 @@
     suggestionTitle = suggestionTitle ? suggestionTitle : `${suggestionDesc.substring(0, 70)}`;
     const channel = client.channels.cache.get(config.suggestionChannel) as Discord.TextChannel;
     const m = await channel.send({ embeds: LoadingEmbed });
-    const issue = await client.GitHub.rest.issues.create({
-        owner: "ClicksMinutePer",
-        repo: "Nucleus",
-        title: suggestionTitle,
-        body: `Linked Suggestion in Private Developer Channel: [Message](${
-            m.url
-        })\n\n**Suggestion:**\n> ${suggestionDesc
-            .replaceAll("@", "@<!-- -->")
-            .replaceAll("/issues", "/issues<!-- -->")
-            .replaceAll("/pull", "/pull<!-- -->")}\n\n`,
-        labels: ["🤖 Auto", "📝 Suggestion"]
-    });
+    let issueNumber: number | null = null;
+    try {
+        const issue = await client.GitHub.rest.issues.create({
+            owner: "ClicksMinutePer",
+            repo: "Nucleus",
+            title: suggestionTitle,
+            body: `Linked Suggestion in Private Developer Channel: [Message](${
+                m.url
+            })\n\n**Suggestion:**\n> ${suggestionDesc
+                .replaceAll("@", "@<!-- -->")
+                .replaceAll("/issues", "/issues<!-- -->")
+                .replaceAll("/pull", "/pull<!-- -->")}\n\n`,
+            labels: ["🤖 Auto", "📝 Suggestion"]
+        });
+        issueNumber = issue.data.number;
+    } catch (_e) {
+        console.log("Could not connect to GitHub");
+    }
+    const disabled = issueNumber ? false : true;
     await m.edit({
         embeds: [
             new EmojiEmbed()
@@ -109,25 +115,27 @@
                 .setTitle(`Suggestion from ${interaction.user.tag} (${interaction.user.id})`)
                 .setDescription(`**Suggestion:**\n> ${suggestionDesc}\n\n`)
                 .setStatus("Success")
-                .setFooter({ text: `${issue.data.number}` })
+                .setFooter({ text: `${issueNumber ? issueNumber : "Could not connect to GitHub"}` })
         ],
         components: [
             new Discord.ActionRowBuilder<ButtonBuilder>().addComponents(
-                new ButtonBuilder().setCustomId("accept:Suggestion").setLabel("Accept").setStyle(ButtonStyle.Success),
-                new ButtonBuilder().setCustomId("deny:Suggestion").setLabel("Deny").setStyle(ButtonStyle.Danger),
-                new ButtonBuilder().setCustomId("close:Suggestion").setLabel("Close").setStyle(ButtonStyle.Secondary),
+                new ButtonBuilder().setCustomId("accept:Suggestion").setLabel("Accept").setStyle(ButtonStyle.Success).setDisabled(disabled),
+                new ButtonBuilder().setCustomId("deny:Suggestion").setLabel("Deny").setStyle(ButtonStyle.Danger).setDisabled(disabled),
+                new ButtonBuilder().setCustomId("close:Suggestion").setLabel("Close").setStyle(ButtonStyle.Secondary).setDisabled(disabled),
                 new ButtonBuilder()
                     .setCustomId("implemented:Suggestion")
                     .setLabel("Implemented")
-                    .setStyle(ButtonStyle.Secondary),
+                    .setStyle(ButtonStyle.Secondary)
+                    .setDisabled(disabled),
                 new ButtonBuilder()
-                    .setLabel(`Open Issue #${issue.data.number}`)
+                    .setLabel(`Open Issue #${issueNumber ? issueNumber : "0"}`)
                     .setStyle(ButtonStyle.Link)
-                    .setURL(`https://github.com/ClicksMinutePer/Nucleus/issues/${issue.data.number}`)
+                    .setURL(`https://github.com/ClicksMinutePer/Nucleus/issues/${issueNumber}`)
+                    .setDisabled(disabled)
             ),
             new Discord.ActionRowBuilder<ButtonBuilder>().addComponents(
-                new ButtonBuilder().setCustomId("lock:Suggestion").setLabel("Lock").setStyle(ButtonStyle.Danger),
-                new ButtonBuilder().setCustomId("spam:Suggestion").setLabel("Mark as Spam").setStyle(ButtonStyle.Danger)
+                new ButtonBuilder().setCustomId("lock:Comment").setLabel("Lock").setStyle(ButtonStyle.Danger).setDisabled(disabled),
+                new ButtonBuilder().setCustomId("spam:Suggestion").setLabel("Mark as Spam").setStyle(ButtonStyle.Danger).setDisabled(disabled)
             )
         ]
     });
diff --git a/src/reflex/guide.ts b/src/reflex/guide.ts
index 59c12c7..1b463cf 100644
--- a/src/reflex/guide.ts
+++ b/src/reflex/guide.ts
@@ -16,35 +16,47 @@
 import createPageIndicator from "../utils/createPageIndicator.js";
 import { Embed } from "../utils/defaults.js";
 
-export default async (guild: Guild, interaction?: CommandInteraction) => {
-    let c: GuildTextBasedChannel | null = guild.publicUpdatesChannel ? guild.publicUpdatesChannel : guild.systemChannel;
-    c = c
-        ? c
-        : (guild.channels.cache.find(
-              (ch) =>
-                  [
-                      ChannelType.GuildText,
-                      ChannelType.GuildAnnouncement,
-                      ChannelType.PublicThread,
-                      ChannelType.PrivateThread,
-                      ChannelType.AnnouncementThread
-                  ].includes(ch.type) &&
-                  ch.permissionsFor(guild.roles.everyone).has("SendMessages") &&
-                  ch.permissionsFor(guild.members.me!).has("EmbedLinks")
-          ) as GuildTextBasedChannel | undefined) ?? null;
-    if (interaction) c = interaction.channel as GuildTextBasedChannel;
-    if (!c) {
-        return;
-    }
+export default async (guild: Guild | null, interaction?: CommandInteraction) => {
     let m: Message;
-    if (interaction) {
-        m = (await interaction.reply({
-            embeds: LoadingEmbed,
-            fetchReply: true,
-            ephemeral: true
-        })) as Message;
+    if (guild) {
+        let c: GuildTextBasedChannel | null = guild.publicUpdatesChannel ? guild.publicUpdatesChannel : guild.systemChannel;
+        c = c
+            ? c
+            : (guild.channels.cache.find(
+                (ch) =>
+                    [
+                        ChannelType.GuildText,
+                        ChannelType.GuildAnnouncement,
+                        ChannelType.PublicThread,
+                        ChannelType.PrivateThread,
+                        ChannelType.AnnouncementThread
+                    ].includes(ch.type) &&
+                    ch.permissionsFor(guild.roles.everyone).has("SendMessages") &&
+                    ch.permissionsFor(guild.members.me!).has("EmbedLinks")
+            ) as GuildTextBasedChannel | undefined) ?? null;
+        if (interaction) c = interaction.channel as GuildTextBasedChannel;
+        if (!c) {
+            return;
+        }
+        if (interaction) {
+            m = (await interaction.reply({
+                embeds: LoadingEmbed,
+                fetchReply: true,
+                ephemeral: true
+            })) as Message;
+        } else {
+            m = await c.send({ embeds: LoadingEmbed });
+        }
     } else {
-        m = await c.send({ embeds: LoadingEmbed });
+        if (interaction) {
+            m = (await interaction.reply({
+                embeds: LoadingEmbed,
+                fetchReply: true,
+                ephemeral: true
+            })) as Message;
+        } else {
+            return;
+        }
     }
     let page = 0;
     const pages = [
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
index 0e4a9b4..f5aaa6b 100644
--- a/src/utils/confirmationMessage.ts
+++ b/src/utils/confirmationMessage.ts
@@ -226,7 +226,7 @@
             try {
                 component = await m.awaitMessageComponent({
                     filter: (i) =>
-                        i.user.id === this.interaction.user.id && i.channel!.id === this.interaction.channel!.id,
+                        i.user.id === this.interaction.user.id && (i.channel ? (i.channel!.id === this.interaction.channel!.id) : true),
                     time: 300000
                 });
             } catch (e) {
diff --git a/src/utils/dualCollector.ts b/src/utils/dualCollector.ts
index e96ff5d..28fa2bc 100644
--- a/src/utils/dualCollector.ts
+++ b/src/utils/dualCollector.ts
@@ -54,7 +54,7 @@
     return i.channel!.id === m.channel!.id && i.user.id === user.id;
 }
 function defaultModalFilter(i: ModalSubmitInteraction, user: User, m: Message) {
-    return i.channel!.id === m.channel!.id && i.user.id === user.id;
+    return (i.channel ? (i.channel!.id === m.channel!.id) : true) && i.user.id === user.id;
 }
 
 export async function modalInteractionCollector(
