Skip to content

Commit

Permalink
work on templates
Browse files Browse the repository at this point in the history
  • Loading branch information
th0mk committed Oct 1, 2024
1 parent bb30838 commit 8080c33
Show file tree
Hide file tree
Showing 8 changed files with 307 additions and 123 deletions.
15 changes: 15 additions & 0 deletions src/FMBot.Bot/Attributes/EmbedOptionAcceptsAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using FMBot.Bot.Models.TemplateOptions;

namespace FMBot.Bot.Attributes;

public class EmbedOptionAcceptsAttribute : Attribute
{
public VariableType[] VariableTypes { get; }

public EmbedOptionAcceptsAttribute(params VariableType[] variableTypes)
{
this.VariableTypes = variableTypes;
}
}

13 changes: 13 additions & 0 deletions src/FMBot.Bot/Attributes/EmbedOptionAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;

namespace FMBot.Bot.Attributes;

public class EmbedOptionAttribute : Attribute
{
public string ScriptName { get; private set; }

public EmbedOptionAttribute(string scriptName)
{
this.ScriptName = scriptName;
}
}
5 changes: 3 additions & 2 deletions src/FMBot.Bot/Builders/TemplateBuilders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@ public async Task<ResponseModel> TemplatePicker(
.WithSelectMenu(templateOptionPicker)
.WithButton("Rename", $"{InteractionConstants.Template.Rename}-{template.Id}", ButtonStyle.Secondary)
.WithButton("Copy", $"{InteractionConstants.Template.Copy}-{template.Id}", ButtonStyle.Secondary)
.WithButton("Delete", $"{InteractionConstants.Template.Delete}-{template.Id}", ButtonStyle.Secondary)
.WithButton("Script", $"{InteractionConstants.Template.ViewScript}-{template.Id}", ButtonStyle.Secondary)
.WithButton("Variables", $"{InteractionConstants.Template.ViewVariables}", ButtonStyle.Secondary);
.WithButton("Variables", $"{InteractionConstants.Template.ViewVariables}", ButtonStyle.Secondary)
.WithButton("Delete", $"{InteractionConstants.Template.Delete}-{template.Id}", ButtonStyle.Danger);

response.Embed.WithAuthor($"Editing template '{template.Name}'");
response.Embed.WithDescription($"Sharecode: `{template.ShareCode}`");
response.Embed.WithColor(DiscordConstants.InformationColorBlue);

var extraResponse = new ResponseModel
Expand Down
Loading

0 comments on commit 8080c33

Please sign in to comment.