Skip to content

Commit

Permalink
Require guild for /note command
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed May 5, 2022
1 parent b7640d3 commit 06c56f7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Hammer/CommandModules/Notes/NoteCommand.Create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
using BrackeysBot.Core.API.Extensions;
using DSharpPlus.Entities;
using DSharpPlus.SlashCommands;
using DSharpPlus.SlashCommands.Attributes;
using Hammer.Data;

namespace Hammer.CommandModules.Notes;

internal sealed partial class NoteCommand
{
[SlashCommand("create", "Creates a new note", false)]
[SlashRequireGuild]
public async Task CreateAsync(InteractionContext context,
[Option("user", "The user for whom to create a note.")] DiscordUser user,
[Option("content", "The content of the note.")] string content)
Expand Down
2 changes: 2 additions & 0 deletions Hammer/CommandModules/Notes/NoteCommand.Delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using BrackeysBot.API.Extensions;
using DSharpPlus.Entities;
using DSharpPlus.SlashCommands;
using DSharpPlus.SlashCommands.Attributes;
using Hammer.AutocompleteProviders;
using Hammer.Data;
using Hammer.Resources;
Expand All @@ -12,6 +13,7 @@ namespace Hammer.CommandModules.Notes;
internal sealed partial class NoteCommand
{
[SlashCommand("delete", "Deletes a note.", false)]
[SlashRequireGuild]
public async Task DeleteAsync(InteractionContext context,
[Autocomplete(typeof(NoteAutocompleteProvider))] [Option("note", "The note to delete.")] long noteId)
{
Expand Down
2 changes: 2 additions & 0 deletions Hammer/CommandModules/Notes/NoteCommand.EditContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using BrackeysBot.API.Extensions;
using DSharpPlus.Entities;
using DSharpPlus.SlashCommands;
using DSharpPlus.SlashCommands.Attributes;
using Hammer.AutocompleteProviders;
using Hammer.Data;
using Hammer.Resources;
Expand All @@ -12,6 +13,7 @@ namespace Hammer.CommandModules.Notes;
internal sealed partial class NoteCommand
{
[SlashCommand("editcontent", "Edits the content of a note.", false)]
[SlashRequireGuild]
public async Task EditContentAsync(InteractionContext context,
[Autocomplete(typeof(NoteAutocompleteProvider))] [Option("note", "The note to edit.")] long noteId,
[Option("content", "The new content of the note.")] string content)
Expand Down
2 changes: 2 additions & 0 deletions Hammer/CommandModules/Notes/NoteCommand.EditType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using BrackeysBot.API.Extensions;
using DSharpPlus.Entities;
using DSharpPlus.SlashCommands;
using DSharpPlus.SlashCommands.Attributes;
using Hammer.AutocompleteProviders;
using Hammer.Data;
using Hammer.Resources;
Expand All @@ -13,6 +14,7 @@ namespace Hammer.CommandModules.Notes;
internal sealed partial class NoteCommand
{
[SlashCommand("edittype", "Edits the type of a note.", false)]
[SlashRequireGuild]
public async Task EditTypeAsync(InteractionContext context,
[Autocomplete(typeof(NoteAutocompleteProvider))] [Option("note", "The note to edit.")] long noteId,
[Option("type", "The new type of the note.")] MemberNoteType type)
Expand Down
2 changes: 2 additions & 0 deletions Hammer/CommandModules/Notes/NoteCommand.View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using DSharpPlus;
using DSharpPlus.Entities;
using DSharpPlus.SlashCommands;
using DSharpPlus.SlashCommands.Attributes;
using Hammer.AutocompleteProviders;
using Hammer.Data;
using Hammer.Resources;
Expand All @@ -15,6 +16,7 @@ namespace Hammer.CommandModules.Notes;
internal sealed partial class NoteCommand
{
[SlashCommand("view", "Views a note.", false)]
[SlashRequireGuild]
public async Task CreateAsync(InteractionContext context,
[Autocomplete(typeof(NoteAutocompleteProvider))] [Option("note", "The note to view.")] long noteId)
{
Expand Down
2 changes: 2 additions & 0 deletions Hammer/CommandModules/Notes/NoteCommand.ViewAll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using BrackeysBot.Core.API.Extensions;
using DSharpPlus.Entities;
using DSharpPlus.SlashCommands;
using DSharpPlus.SlashCommands.Attributes;
using Hammer.Data;
using Hammer.Resources;
using PermissionLevel = BrackeysBot.Core.API.PermissionLevel;
Expand All @@ -15,6 +16,7 @@ namespace Hammer.CommandModules.Notes;
internal sealed partial class NoteCommand
{
[SlashCommand("viewall", "Views all notes for a given user.", false)]
[SlashRequireGuild]
public async Task ViewAllAsync(InteractionContext context,
[Option("user", "The user whose notes to view.")] DiscordUser user)
{
Expand Down

0 comments on commit 06c56f7

Please sign in to comment.