forked from VelvetToroyashi/Silk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d373034
commit 434dddf
Showing
17 changed files
with
130 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/Silk.Core/Commands/Server/Configuration/BaseConfigCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Threading.Tasks; | ||
using DSharpPlus; | ||
using DSharpPlus.CommandsNext; | ||
using DSharpPlus.CommandsNext.Attributes; | ||
using DSharpPlus.Entities; | ||
|
||
namespace Silk.Core.Commands.Server.Configuration | ||
{ | ||
|
||
[RequireGuild] | ||
[Group("config")] | ||
[Aliases("configuration")] | ||
[RequireUserPermissions(Permissions.ManageGuild)] | ||
[Description("Edit configurations the caveman way!\nOr perhaps we just haven't launched the dashboard yet..")] | ||
public partial class BaseConfigCommand : BaseCommandModule | ||
{ | ||
[GroupCommand] | ||
public async Task Config(CommandContext ctx) => | ||
await new DiscordMessageBuilder() | ||
.WithReply(ctx.Message.Id, true) | ||
.WithContent($"See `{ctx.Prefix}help config` instead.") | ||
.SendAsync(ctx.Channel); | ||
// This just serves to tell the user to see the help instead. | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Silk.Core/Commands/Server/Configuration/BaseEditConfigCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Threading.Tasks; | ||
using DSharpPlus.CommandsNext; | ||
using DSharpPlus.CommandsNext.Attributes; | ||
using DSharpPlus.Entities; | ||
|
||
namespace Silk.Core.Commands.Server.Configuration | ||
{ | ||
public partial class BaseConfigCommand | ||
{ | ||
[Group("edit")] | ||
public partial class BaseEditConfigCommand : BaseCommandModule | ||
{ | ||
[GroupCommand] | ||
public async Task EditConfig(CommandContext ctx) => | ||
await new DiscordMessageBuilder() | ||
.WithReply(ctx.Message.Id, true) | ||
.WithContent($"See `{ctx.Prefix}help config edit`.") | ||
.SendAsync(ctx.Channel); | ||
} | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
src/Silk.Core/Commands/Server/Configuration/ResetConfigCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using DSharpPlus.CommandsNext; | ||
using DSharpPlus.CommandsNext.Attributes; | ||
using DSharpPlus.Entities; | ||
using DSharpPlus.Interactivity.Extensions; | ||
|
||
namespace Silk.Core.Commands.Server.Configuration | ||
{ | ||
//[Group("config")] | ||
public class ResetConfigCommand : BaseCommandModule | ||
{ | ||
[Command] | ||
public async Task Reset(CommandContext ctx) | ||
{ | ||
var builder = new DiscordMessageBuilder(); | ||
var confirmationCode = new Random((int) ctx.Message.Id).Next(1000, 10000); | ||
builder.WithReply(ctx.Message.Id, true); | ||
builder.WithContent($"**All settings will be reset** (This does not include server prefix) | Are you sure? Type `{confirmationCode}` to confirm. Type cancel to cancel"); | ||
await ctx.RespondAsync(builder); | ||
|
||
var interactivity = ctx.Client.GetInteractivity(); | ||
var result = await interactivity.WaitForMessageAsync(m => m.Content.Equals("cancel", StringComparison.CurrentCultureIgnoreCase) || m.Content.Equals(confirmationCode)); | ||
|
||
|
||
|
||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Silk.Core.Constants | ||
{ | ||
/// <summary> | ||
/// A class containing const | ||
/// </summary> | ||
public static class GeneralMessages | ||
{ | ||
public const string | ||
NoConfigValue = "Not configured"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.