-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
* Added Slash commands functionality and utilities commands * Added modmail system * Added guild config editing and polished modmail system * Finished user notes system * Added ban appeals system --------- Co-authored-by: Israel Aristide <[email protected]>
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Arc.Schema; | ||
using DSharpPlus.Entities; | ||
using DSharpPlus; | ||
namespace ARC.Extensions; | ||
|
||
public static class GuildExtensions | ||
{ | ||
|
||
private static ArcDbContext DbContext => Arc.Arc.ArcDbContext; | ||
private static DiscordClient ClientInstance => Arc.Arc.ClientInstance; | ||
|
||
public static async Task Log(this DiscordGuild guild, DiscordMessageBuilder message) | ||
{ | ||
|
||
if (!DbContext.Config[guild.Id].ContainsKey("logchannel")) | ||
return; | ||
|
||
ulong logChannelSnowflake = ulong.Parse(DbContext.Config[guild.Id]["logchannel"]); | ||
var channel = await ClientInstance.GetChannelAsync(logChannelSnowflake); | ||
|
||
await channel.SendMessageAsync(message); | ||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace ARC.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class ArcV211 : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AddColumn<long>( | ||
name: "GuildSnowflake", | ||
table: "UserNotes", | ||
type: "bigint", | ||
nullable: false, | ||
defaultValue: 0L); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropColumn( | ||
name: "GuildSnowflake", | ||
table: "UserNotes"); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
| ||
using Arc.Schema; | ||
using DSharpPlus; | ||
using DSharpPlus.SlashCommands; | ||
using Microsoft.Extensions.Configuration; | ||
using Serilog; | ||
|
||
|
||
namespace ARC.Modules | ||
{ | ||
internal abstract class ArcModule : ApplicationCommandModule | ||
{ | ||
|
||
protected static bool _loaded = false; | ||
protected readonly ArcDbContext DbContext; | ||
protected readonly IServiceProvider ServiceProvider; | ||
protected readonly DiscordClient ClientInstance; | ||
protected readonly IConfigurationRoot GlobalConfig; | ||
|
||
protected ArcModule(string moduleName) | ||
{ | ||
|
||
DbContext = Arc.Arc.ArcDbContext; | ||
ServiceProvider = Arc.Arc.ServiceProvider; | ||
ClientInstance = Arc.Arc.ClientInstance; | ||
GlobalConfig = Arc.Arc.GlobalConfig; | ||
|
||
if (_loaded) | ||
return; | ||
RegisterEvents(); | ||
Log.Logger.Information($"MODULE LOADED: {moduleName}"); | ||
_loaded = true; | ||
} | ||
|
||
protected abstract void RegisterEvents(); | ||
|
||
} | ||
} |