diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f6a929b1..564c48a8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -253,6 +253,8 @@ jobs:
}
}
+ console.log(dotnetCommand);
+
try {
child_process.execSync(dotnetCommand, { stdio: 'inherit' });
} catch (error) {
@@ -264,6 +266,8 @@ jobs:
// Zip the component, and move it to the deploy directory
const zipCommand = `zip -r ${path.resolve(deployDirectory, `${componentConfig.component}.zip`)} .`;
+ console.log(zipCommand);
+
try {
child_process.execSync(zipCommand, { stdio: 'inherit', cwd: componentConfig.build.component_directory });
} catch (error) {
@@ -271,6 +275,15 @@ jobs:
return;
}
+
+ const lsCommand = `ls -la ${deployDirectory}`
+ try {
+ child_process.execSync(lsCommand, { stdio: 'inherit' });
+ } catch (error) {
+ core.setFailed(`Failed to ls component ${component}`);
+
+ return;
+ }
}
@@ -282,7 +295,9 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: components
- path: ${{ steps.build-components.outputs.deploy-directory }}/*.zip
+ path: .deploy/*.zip
+ if-no-files-found: error
+ include-hidden-files: true
# No need for checkout, downloads the component archives from the
diff --git a/services/grid-bot/lib/commands/Modules/ExecuteScript.cs b/services/grid-bot/lib/commands/Modules/ExecuteScript.cs
index f345106f..b25e4f4f 100644
--- a/services/grid-bot/lib/commands/Modules/ExecuteScript.cs
+++ b/services/grid-bot/lib/commands/Modules/ExecuteScript.cs
@@ -58,6 +58,8 @@ namespace Grid.Bot.Interactions.Public;
/// - cannot be null.
///
[Group("execute", "Commands used for executing Luau code.")]
+[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
+[CommandContextType(InteractionContextType.Guild, InteractionContextType.BotDm, InteractionContextType.PrivateChannel)]
public partial class ExecuteScript(
ILogger logger,
GridSettings gridSettings,
@@ -143,6 +145,19 @@ private static string GetCodeBlockContents(string s)
{
if (string.IsNullOrEmpty(input)) return (null, null);
+ // Check if the input matches grid syntax error
+ if (GridSyntaxErrorRegex().IsMatch(input))
+ {
+ var match = GridSyntaxErrorRegex().Match(input);
+ var line = match.Groups[1].Value;
+ var error = match.Groups[2].Value;
+
+ input = $"Line {line}: {error}";
+ }
+
+ // Replace backticks with escaped backticks
+ input = input.Replace("`", "\\`");
+
if (input.Length > _maxErrorLength)
{
var maxSize = _scriptsSettings.ScriptExecutionMaxFileSizeKb;
@@ -160,6 +175,9 @@ private static string GetCodeBlockContents(string s)
{
if (string.IsNullOrEmpty(input)) return (null, null);
+ // Replace backticks with escaped backticks
+ input = input.Replace("`", "\\`");
+
if (input.Length > _maxResultLength)
{
var maxSize = _scriptsSettings.ScriptExecutionMaxResultSizeKb;
@@ -259,10 +277,10 @@ private async Task ParseLuaAsync(string input)
}
var embed = new EmbedBuilder()
- .WithTitle("Luau Syntax Error")
+ .WithTitle("Lua Error")
.WithAuthor(Context.User)
.WithCurrentTimestamp()
- .WithColor(0xff, 0x00, 0x00)
+ .WithColor(Color.Red)
.WithDescription($"```\n{errorString}\n```")
.Build();
diff --git a/services/grid-bot/lib/commands/Modules/Render.cs b/services/grid-bot/lib/commands/Modules/Render.cs
index 57d364a4..e69829be 100644
--- a/services/grid-bot/lib/commands/Modules/Render.cs
+++ b/services/grid-bot/lib/commands/Modules/Render.cs
@@ -3,6 +3,7 @@ namespace Grid.Bot.Interactions.Public;
using System;
using System.Threading.Tasks;
+using Discord;
using Discord.Interactions;
using Logging;
@@ -31,6 +32,8 @@ namespace Grid.Bot.Interactions.Public;
/// - cannot be null.
///
[Group("render", "Commands used for rendering a Roblox character.")]
+[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
+[CommandContextType(InteractionContextType.Guild, InteractionContextType.BotDm, InteractionContextType.PrivateChannel)]
public class Render(
AvatarSettings avatarSettings,
ILogger logger,
diff --git a/services/grid-bot/lib/commands/Modules/Support.cs b/services/grid-bot/lib/commands/Modules/Support.cs
index 1e55be3f..9ea0e7cd 100644
--- a/services/grid-bot/lib/commands/Modules/Support.cs
+++ b/services/grid-bot/lib/commands/Modules/Support.cs
@@ -28,6 +28,8 @@ namespace Grid.Bot.Interactions.Public;
/// - cannot be null.
///
[Group("support", "Commands used for grid-bot-support.")]
+[IntegrationType(ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall)]
+[CommandContextType(InteractionContextType.Guild, InteractionContextType.BotDm, InteractionContextType.PrivateChannel)]
public class Support(
GridSettings gridSettings,
GlobalSettings globalSettings,
diff --git a/services/grid-bot/lib/commands/PrivateModules/ClientSettings.cs b/services/grid-bot/lib/commands/PrivateModules/ClientSettings.cs
index fa177e62..d4e124cf 100644
--- a/services/grid-bot/lib/commands/PrivateModules/ClientSettings.cs
+++ b/services/grid-bot/lib/commands/PrivateModules/ClientSettings.cs
@@ -28,8 +28,10 @@ namespace Grid.Bot.Interactions.Private;
/// - cannot be null.
/// - cannot be null.
///
-[Group("clientsettings", "Manage the client settings.")]
[RequireBotRole(BotRole.Administrator)]
+[CommandContextType(InteractionContextType.Guild)]
+[IntegrationType(ApplicationIntegrationType.GuildInstall)]
+[Group("clientsettings", "Manage the client settings.")]
public class ClientSettingsModule(IClientSettingsClient clientSettingsClient, ClientSettingsClientSettings clientSettingsClientSettings) : InteractionModuleBase
{
private readonly IClientSettingsClient _clientSettingsClient = clientSettingsClient ?? throw new ArgumentNullException(nameof(clientSettingsClient));
diff --git a/services/grid-bot/lib/commands/PrivateModules/Maintenance.cs b/services/grid-bot/lib/commands/PrivateModules/Maintenance.cs
index 55d6c249..190e99ed 100644
--- a/services/grid-bot/lib/commands/PrivateModules/Maintenance.cs
+++ b/services/grid-bot/lib/commands/PrivateModules/Maintenance.cs
@@ -21,8 +21,10 @@ namespace Grid.Bot.Interactions.Private;
/// - cannot be null.
/// - cannot be null.
///
-[Group("maintenance", "Commands used for grid-bot-maintenance.")]
[RequireBotRole(BotRole.Administrator)]
+[CommandContextType(InteractionContextType.Guild)]
+[IntegrationType(ApplicationIntegrationType.GuildInstall)]
+[Group("maintenance", "Commands used for grid-bot-maintenance.")]
public class Maintenance(
MaintenanceSettings maintenanceSettings,
DiscordSettings discordSettings,
diff --git a/services/grid-bot/lib/commands/PrivateModules/Roles.cs b/services/grid-bot/lib/commands/PrivateModules/Roles.cs
index 669920f1..21992e65 100644
--- a/services/grid-bot/lib/commands/PrivateModules/Roles.cs
+++ b/services/grid-bot/lib/commands/PrivateModules/Roles.cs
@@ -20,8 +20,10 @@ namespace Grid.Bot.Interactions.Private;
/// - cannot be null.
/// - cannot be null.
///
-[Group("role", "Commands used for updating user bot roles.")]
[RequireBotRole(BotRole.Administrator)]
+[CommandContextType(InteractionContextType.Guild)]
+[IntegrationType(ApplicationIntegrationType.GuildInstall)]
+[Group("role", "Commands used for updating user bot roles.")]
public class Roles(
DiscordRolesSettings discordRolesSettings,
IAdminUtility adminUtility
diff --git a/services/grid-bot/lib/events/Events/OnReady.cs b/services/grid-bot/lib/events/Events/OnReady.cs
index 8752a678..4150031e 100644
--- a/services/grid-bot/lib/events/Events/OnReady.cs
+++ b/services/grid-bot/lib/events/Events/OnReady.cs
@@ -94,6 +94,8 @@ public async Task Invoke(DiscordSocketClient shard)
#if DEBUG
if (_discordSettings.DebugGuildId != 0)
await _interactionService.RegisterCommandsToGuildAsync(_discordSettings.DebugGuildId);
+ else
+ await _interactionService.RegisterCommandsGloballyAsync();
#else
await _interactionService.RegisterCommandsGloballyAsync();
#endif