Bot config, playing statuses, a LOT of other stuff
This commit is contained in:
		@@ -8,7 +8,7 @@ using NadekoBot.Services.Database.Impl;
 | 
			
		||||
namespace NadekoBot.Migrations
 | 
			
		||||
{
 | 
			
		||||
    [DbContext(typeof(NadekoSqliteContext))]
 | 
			
		||||
    [Migration("20160826234229_first")]
 | 
			
		||||
    [Migration("20160828000228_first")]
 | 
			
		||||
    partial class first
 | 
			
		||||
    {
 | 
			
		||||
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 | 
			
		||||
@@ -16,6 +16,50 @@ namespace NadekoBot.Migrations
 | 
			
		||||
            modelBuilder
 | 
			
		||||
                .HasAnnotation("ProductVersion", "1.0.0-rtm-21431");
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.BlacklistItem", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<int?>("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<ulong>("ItemId");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.HasIndex("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("BlacklistItem");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.BotConfig", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<ulong>("BufferSize");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("CurrencyName");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("CurrencyPluralName");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("CurrencySign");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("DontJoinServers");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("ForwardMessages");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("ForwardToAllOwners");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("RemindMessageFormat");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("RotatingStatuses");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("BotConfig");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.ClashCaller", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
@@ -79,6 +123,22 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                    b.ToTable("Donators");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.EightBallResponse", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<int?>("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("Text");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.HasIndex("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("EightBallResponse");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.GuildConfig", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
@@ -110,8 +170,6 @@ namespace NadekoBot.Migrations
 | 
			
		||||
 | 
			
		||||
                    b.Property<ulong>("GuildId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("RotatingStatuses");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("SendChannelByeMessage");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("SendChannelGreetMessage");
 | 
			
		||||
@@ -126,18 +184,36 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                    b.ToTable("GuildConfigs");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.ModulePrefix", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<int?>("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("ModuleName");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("Prefix");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.HasIndex("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("ModulePrefix");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.PlayingStatus", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<int?>("GuildConfigId");
 | 
			
		||||
                    b.Property<int?>("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("Status");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.HasIndex("GuildConfigId");
 | 
			
		||||
                    b.HasIndex("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("PlayingStatus");
 | 
			
		||||
                });
 | 
			
		||||
@@ -165,6 +241,24 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                    b.ToTable("Quotes");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.RaceAnimal", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<int?>("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("Icon");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("Name");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.HasIndex("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("RaceAnimal");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.Reminder", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
@@ -204,6 +298,13 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                    b.ToTable("SelfAssignableRoles");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.BlacklistItem", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
 | 
			
		||||
                        .WithMany("Blacklist")
 | 
			
		||||
                        .HasForeignKey("BotConfigId");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.ClashCaller", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.ClashWar", "ClashWar")
 | 
			
		||||
@@ -212,11 +313,32 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                        .OnDelete(DeleteBehavior.Cascade);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.EightBallResponse", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
 | 
			
		||||
                        .WithMany("EightBallResponses")
 | 
			
		||||
                        .HasForeignKey("BotConfigId");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.ModulePrefix", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
 | 
			
		||||
                        .WithMany("ModulePrefixes")
 | 
			
		||||
                        .HasForeignKey("BotConfigId");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.PlayingStatus", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.GuildConfig")
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
 | 
			
		||||
                        .WithMany("RotatingStatusMessages")
 | 
			
		||||
                        .HasForeignKey("GuildConfigId");
 | 
			
		||||
                        .HasForeignKey("BotConfigId");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.RaceAnimal", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
 | 
			
		||||
                        .WithMany("RaceAnimals")
 | 
			
		||||
                        .HasForeignKey("BotConfigId");
 | 
			
		||||
                });
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@@ -8,6 +8,27 @@ namespace NadekoBot.Migrations
 | 
			
		||||
    {
 | 
			
		||||
        protected override void Up(MigrationBuilder migrationBuilder)
 | 
			
		||||
        {
 | 
			
		||||
            migrationBuilder.CreateTable(
 | 
			
		||||
                name: "BotConfig",
 | 
			
		||||
                columns: table => new
 | 
			
		||||
                {
 | 
			
		||||
                    Id = table.Column<int>(nullable: false)
 | 
			
		||||
                        .Annotation("Autoincrement", true),
 | 
			
		||||
                    BufferSize = table.Column<ulong>(nullable: false),
 | 
			
		||||
                    CurrencyName = table.Column<string>(nullable: true),
 | 
			
		||||
                    CurrencyPluralName = table.Column<string>(nullable: true),
 | 
			
		||||
                    CurrencySign = table.Column<string>(nullable: true),
 | 
			
		||||
                    DontJoinServers = table.Column<bool>(nullable: false),
 | 
			
		||||
                    ForwardMessages = table.Column<bool>(nullable: false),
 | 
			
		||||
                    ForwardToAllOwners = table.Column<bool>(nullable: false),
 | 
			
		||||
                    RemindMessageFormat = table.Column<string>(nullable: true),
 | 
			
		||||
                    RotatingStatuses = table.Column<bool>(nullable: false)
 | 
			
		||||
                },
 | 
			
		||||
                constraints: table =>
 | 
			
		||||
                {
 | 
			
		||||
                    table.PrimaryKey("PK_BotConfig", x => x.Id);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateTable(
 | 
			
		||||
                name: "ClashOfClans",
 | 
			
		||||
                columns: table => new
 | 
			
		||||
@@ -60,7 +81,6 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                    ExclusiveSelfAssignedRoles = table.Column<bool>(nullable: false),
 | 
			
		||||
                    GreetMessageChannelId = table.Column<ulong>(nullable: false),
 | 
			
		||||
                    GuildId = table.Column<ulong>(nullable: false),
 | 
			
		||||
                    RotatingStatuses = table.Column<bool>(nullable: false),
 | 
			
		||||
                    SendChannelByeMessage = table.Column<bool>(nullable: false),
 | 
			
		||||
                    SendChannelGreetMessage = table.Column<bool>(nullable: false),
 | 
			
		||||
                    SendDmGreetMessage = table.Column<bool>(nullable: false)
 | 
			
		||||
@@ -119,6 +139,108 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                    table.PrimaryKey("PK_SelfAssignableRoles", x => x.Id);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateTable(
 | 
			
		||||
                name: "BlacklistItem",
 | 
			
		||||
                columns: table => new
 | 
			
		||||
                {
 | 
			
		||||
                    Id = table.Column<int>(nullable: false)
 | 
			
		||||
                        .Annotation("Autoincrement", true),
 | 
			
		||||
                    BotConfigId = table.Column<int>(nullable: true),
 | 
			
		||||
                    ItemId = table.Column<ulong>(nullable: false)
 | 
			
		||||
                },
 | 
			
		||||
                constraints: table =>
 | 
			
		||||
                {
 | 
			
		||||
                    table.PrimaryKey("PK_BlacklistItem", x => x.Id);
 | 
			
		||||
                    table.ForeignKey(
 | 
			
		||||
                        name: "FK_BlacklistItem_BotConfig_BotConfigId",
 | 
			
		||||
                        column: x => x.BotConfigId,
 | 
			
		||||
                        principalTable: "BotConfig",
 | 
			
		||||
                        principalColumn: "Id",
 | 
			
		||||
                        onDelete: ReferentialAction.Restrict);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateTable(
 | 
			
		||||
                name: "EightBallResponse",
 | 
			
		||||
                columns: table => new
 | 
			
		||||
                {
 | 
			
		||||
                    Id = table.Column<int>(nullable: false)
 | 
			
		||||
                        .Annotation("Autoincrement", true),
 | 
			
		||||
                    BotConfigId = table.Column<int>(nullable: true),
 | 
			
		||||
                    Text = table.Column<string>(nullable: true)
 | 
			
		||||
                },
 | 
			
		||||
                constraints: table =>
 | 
			
		||||
                {
 | 
			
		||||
                    table.PrimaryKey("PK_EightBallResponse", x => x.Id);
 | 
			
		||||
                    table.ForeignKey(
 | 
			
		||||
                        name: "FK_EightBallResponse_BotConfig_BotConfigId",
 | 
			
		||||
                        column: x => x.BotConfigId,
 | 
			
		||||
                        principalTable: "BotConfig",
 | 
			
		||||
                        principalColumn: "Id",
 | 
			
		||||
                        onDelete: ReferentialAction.Restrict);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateTable(
 | 
			
		||||
                name: "ModulePrefix",
 | 
			
		||||
                columns: table => new
 | 
			
		||||
                {
 | 
			
		||||
                    Id = table.Column<int>(nullable: false)
 | 
			
		||||
                        .Annotation("Autoincrement", true),
 | 
			
		||||
                    BotConfigId = table.Column<int>(nullable: true),
 | 
			
		||||
                    ModuleName = table.Column<string>(nullable: true),
 | 
			
		||||
                    Prefix = table.Column<string>(nullable: true)
 | 
			
		||||
                },
 | 
			
		||||
                constraints: table =>
 | 
			
		||||
                {
 | 
			
		||||
                    table.PrimaryKey("PK_ModulePrefix", x => x.Id);
 | 
			
		||||
                    table.ForeignKey(
 | 
			
		||||
                        name: "FK_ModulePrefix_BotConfig_BotConfigId",
 | 
			
		||||
                        column: x => x.BotConfigId,
 | 
			
		||||
                        principalTable: "BotConfig",
 | 
			
		||||
                        principalColumn: "Id",
 | 
			
		||||
                        onDelete: ReferentialAction.Restrict);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateTable(
 | 
			
		||||
                name: "PlayingStatus",
 | 
			
		||||
                columns: table => new
 | 
			
		||||
                {
 | 
			
		||||
                    Id = table.Column<int>(nullable: false)
 | 
			
		||||
                        .Annotation("Autoincrement", true),
 | 
			
		||||
                    BotConfigId = table.Column<int>(nullable: true),
 | 
			
		||||
                    Status = table.Column<string>(nullable: true)
 | 
			
		||||
                },
 | 
			
		||||
                constraints: table =>
 | 
			
		||||
                {
 | 
			
		||||
                    table.PrimaryKey("PK_PlayingStatus", x => x.Id);
 | 
			
		||||
                    table.ForeignKey(
 | 
			
		||||
                        name: "FK_PlayingStatus_BotConfig_BotConfigId",
 | 
			
		||||
                        column: x => x.BotConfigId,
 | 
			
		||||
                        principalTable: "BotConfig",
 | 
			
		||||
                        principalColumn: "Id",
 | 
			
		||||
                        onDelete: ReferentialAction.Restrict);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateTable(
 | 
			
		||||
                name: "RaceAnimal",
 | 
			
		||||
                columns: table => new
 | 
			
		||||
                {
 | 
			
		||||
                    Id = table.Column<int>(nullable: false)
 | 
			
		||||
                        .Annotation("Autoincrement", true),
 | 
			
		||||
                    BotConfigId = table.Column<int>(nullable: true),
 | 
			
		||||
                    Icon = table.Column<string>(nullable: true),
 | 
			
		||||
                    Name = table.Column<string>(nullable: true)
 | 
			
		||||
                },
 | 
			
		||||
                constraints: table =>
 | 
			
		||||
                {
 | 
			
		||||
                    table.PrimaryKey("PK_RaceAnimal", x => x.Id);
 | 
			
		||||
                    table.ForeignKey(
 | 
			
		||||
                        name: "FK_RaceAnimal_BotConfig_BotConfigId",
 | 
			
		||||
                        column: x => x.BotConfigId,
 | 
			
		||||
                        principalTable: "BotConfig",
 | 
			
		||||
                        principalColumn: "Id",
 | 
			
		||||
                        onDelete: ReferentialAction.Restrict);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateTable(
 | 
			
		||||
                name: "ClashCallers",
 | 
			
		||||
                columns: table => new
 | 
			
		||||
@@ -142,25 +264,10 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                        onDelete: ReferentialAction.Cascade);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateTable(
 | 
			
		||||
                name: "PlayingStatus",
 | 
			
		||||
                columns: table => new
 | 
			
		||||
                {
 | 
			
		||||
                    Id = table.Column<int>(nullable: false)
 | 
			
		||||
                        .Annotation("Autoincrement", true),
 | 
			
		||||
                    GuildConfigId = table.Column<int>(nullable: true),
 | 
			
		||||
                    Status = table.Column<string>(nullable: true)
 | 
			
		||||
                },
 | 
			
		||||
                constraints: table =>
 | 
			
		||||
                {
 | 
			
		||||
                    table.PrimaryKey("PK_PlayingStatus", x => x.Id);
 | 
			
		||||
                    table.ForeignKey(
 | 
			
		||||
                        name: "FK_PlayingStatus_GuildConfigs_GuildConfigId",
 | 
			
		||||
                        column: x => x.GuildConfigId,
 | 
			
		||||
                        principalTable: "GuildConfigs",
 | 
			
		||||
                        principalColumn: "Id",
 | 
			
		||||
                        onDelete: ReferentialAction.Restrict);
 | 
			
		||||
                });
 | 
			
		||||
            migrationBuilder.CreateIndex(
 | 
			
		||||
                name: "IX_BlacklistItem_BotConfigId",
 | 
			
		||||
                table: "BlacklistItem",
 | 
			
		||||
                column: "BotConfigId");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateIndex(
 | 
			
		||||
                name: "IX_ClashCallers_ClashWarId",
 | 
			
		||||
@@ -173,6 +280,11 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                column: "UserId",
 | 
			
		||||
                unique: true);
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateIndex(
 | 
			
		||||
                name: "IX_EightBallResponse_BotConfigId",
 | 
			
		||||
                table: "EightBallResponse",
 | 
			
		||||
                column: "BotConfigId");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateIndex(
 | 
			
		||||
                name: "IX_GuildConfigs_GuildId",
 | 
			
		||||
                table: "GuildConfigs",
 | 
			
		||||
@@ -180,9 +292,19 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                unique: true);
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateIndex(
 | 
			
		||||
                name: "IX_PlayingStatus_GuildConfigId",
 | 
			
		||||
                name: "IX_ModulePrefix_BotConfigId",
 | 
			
		||||
                table: "ModulePrefix",
 | 
			
		||||
                column: "BotConfigId");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateIndex(
 | 
			
		||||
                name: "IX_PlayingStatus_BotConfigId",
 | 
			
		||||
                table: "PlayingStatus",
 | 
			
		||||
                column: "GuildConfigId");
 | 
			
		||||
                column: "BotConfigId");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateIndex(
 | 
			
		||||
                name: "IX_RaceAnimal_BotConfigId",
 | 
			
		||||
                table: "RaceAnimal",
 | 
			
		||||
                column: "BotConfigId");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.CreateIndex(
 | 
			
		||||
                name: "IX_SelfAssignableRoles_GuildId_RoleId",
 | 
			
		||||
@@ -193,18 +315,33 @@ namespace NadekoBot.Migrations
 | 
			
		||||
 | 
			
		||||
        protected override void Down(MigrationBuilder migrationBuilder)
 | 
			
		||||
        {
 | 
			
		||||
            migrationBuilder.DropTable(
 | 
			
		||||
                name: "BlacklistItem");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.DropTable(
 | 
			
		||||
                name: "ClashCallers");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.DropTable(
 | 
			
		||||
                name: "Donators");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.DropTable(
 | 
			
		||||
                name: "EightBallResponse");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.DropTable(
 | 
			
		||||
                name: "GuildConfigs");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.DropTable(
 | 
			
		||||
                name: "ModulePrefix");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.DropTable(
 | 
			
		||||
                name: "PlayingStatus");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.DropTable(
 | 
			
		||||
                name: "Quotes");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.DropTable(
 | 
			
		||||
                name: "RaceAnimal");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.DropTable(
 | 
			
		||||
                name: "Reminders");
 | 
			
		||||
 | 
			
		||||
@@ -215,7 +352,7 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                name: "ClashOfClans");
 | 
			
		||||
 | 
			
		||||
            migrationBuilder.DropTable(
 | 
			
		||||
                name: "GuildConfigs");
 | 
			
		||||
                name: "BotConfig");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -15,6 +15,50 @@ namespace NadekoBot.Migrations
 | 
			
		||||
            modelBuilder
 | 
			
		||||
                .HasAnnotation("ProductVersion", "1.0.0-rtm-21431");
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.BlacklistItem", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<int?>("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<ulong>("ItemId");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.HasIndex("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("BlacklistItem");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.BotConfig", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<ulong>("BufferSize");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("CurrencyName");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("CurrencyPluralName");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("CurrencySign");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("DontJoinServers");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("ForwardMessages");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("ForwardToAllOwners");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("RemindMessageFormat");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("RotatingStatuses");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("BotConfig");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.ClashCaller", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
@@ -78,6 +122,22 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                    b.ToTable("Donators");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.EightBallResponse", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<int?>("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("Text");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.HasIndex("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("EightBallResponse");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.GuildConfig", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
@@ -109,8 +169,6 @@ namespace NadekoBot.Migrations
 | 
			
		||||
 | 
			
		||||
                    b.Property<ulong>("GuildId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("RotatingStatuses");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("SendChannelByeMessage");
 | 
			
		||||
 | 
			
		||||
                    b.Property<bool>("SendChannelGreetMessage");
 | 
			
		||||
@@ -125,18 +183,36 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                    b.ToTable("GuildConfigs");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.ModulePrefix", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<int?>("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("ModuleName");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("Prefix");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.HasIndex("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("ModulePrefix");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.PlayingStatus", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<int?>("GuildConfigId");
 | 
			
		||||
                    b.Property<int?>("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("Status");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.HasIndex("GuildConfigId");
 | 
			
		||||
                    b.HasIndex("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("PlayingStatus");
 | 
			
		||||
                });
 | 
			
		||||
@@ -164,6 +240,24 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                    b.ToTable("Quotes");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.RaceAnimal", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
                        .ValueGeneratedOnAdd();
 | 
			
		||||
 | 
			
		||||
                    b.Property<int?>("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("Icon");
 | 
			
		||||
 | 
			
		||||
                    b.Property<string>("Name");
 | 
			
		||||
 | 
			
		||||
                    b.HasKey("Id");
 | 
			
		||||
 | 
			
		||||
                    b.HasIndex("BotConfigId");
 | 
			
		||||
 | 
			
		||||
                    b.ToTable("RaceAnimal");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.Reminder", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.Property<int>("Id")
 | 
			
		||||
@@ -203,6 +297,13 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                    b.ToTable("SelfAssignableRoles");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.BlacklistItem", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
 | 
			
		||||
                        .WithMany("Blacklist")
 | 
			
		||||
                        .HasForeignKey("BotConfigId");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.ClashCaller", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.ClashWar", "ClashWar")
 | 
			
		||||
@@ -211,11 +312,32 @@ namespace NadekoBot.Migrations
 | 
			
		||||
                        .OnDelete(DeleteBehavior.Cascade);
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.EightBallResponse", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
 | 
			
		||||
                        .WithMany("EightBallResponses")
 | 
			
		||||
                        .HasForeignKey("BotConfigId");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.ModulePrefix", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
 | 
			
		||||
                        .WithMany("ModulePrefixes")
 | 
			
		||||
                        .HasForeignKey("BotConfigId");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.PlayingStatus", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.GuildConfig")
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
 | 
			
		||||
                        .WithMany("RotatingStatusMessages")
 | 
			
		||||
                        .HasForeignKey("GuildConfigId");
 | 
			
		||||
                        .HasForeignKey("BotConfigId");
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
            modelBuilder.Entity("NadekoBot.Services.Database.Models.RaceAnimal", b =>
 | 
			
		||||
                {
 | 
			
		||||
                    b.HasOne("NadekoBot.Services.Database.Models.BotConfig")
 | 
			
		||||
                        .WithMany("RaceAnimals")
 | 
			
		||||
                        .HasForeignKey("BotConfigId");
 | 
			
		||||
                });
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
    [Module(".", AppendSpace = false)]
 | 
			
		||||
    public partial class Administration : DiscordModule
 | 
			
		||||
    {
 | 
			
		||||
        public Administration(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client) : base(loc, cmds, config, client)
 | 
			
		||||
        public Administration(ILocalization loc, CommandService cmds, DiscordSocketClient client) : base(loc, cmds, client)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,7 @@ using NadekoBot.Attributes;
 | 
			
		||||
using NadekoBot.Services;
 | 
			
		||||
using NadekoBot.Services.Database;
 | 
			
		||||
using NadekoBot.Services.Database.Models;
 | 
			
		||||
using NLog;
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
@@ -20,6 +21,52 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
        [Group]
 | 
			
		||||
        public class PlayingRotateCommands
 | 
			
		||||
        {
 | 
			
		||||
            private Logger _log { get; }
 | 
			
		||||
 | 
			
		||||
            public PlayingRotateCommands()
 | 
			
		||||
            {
 | 
			
		||||
                _log = LogManager.GetCurrentClassLogger();
 | 
			
		||||
                Task.Run(async () =>
 | 
			
		||||
                {
 | 
			
		||||
                    var index = 0;
 | 
			
		||||
                    do
 | 
			
		||||
                    {
 | 
			
		||||
                        try
 | 
			
		||||
                        {
 | 
			
		||||
                            BotConfig conf;
 | 
			
		||||
                            using (var uow = DbHandler.UnitOfWork())
 | 
			
		||||
                            {
 | 
			
		||||
                                conf = uow.BotConfig.GetOrCreate();
 | 
			
		||||
                            }
 | 
			
		||||
 | 
			
		||||
                            if (!conf.RotatingStatuses)
 | 
			
		||||
                                continue;
 | 
			
		||||
                            else
 | 
			
		||||
                            {
 | 
			
		||||
                                if (index >= conf.RotatingStatusMessages.Count)
 | 
			
		||||
                                    index = 0;
 | 
			
		||||
 | 
			
		||||
                                if (!conf.RotatingStatusMessages.Any())
 | 
			
		||||
                                    continue;
 | 
			
		||||
 | 
			
		||||
                                await NadekoBot.Client
 | 
			
		||||
                                    .GetCurrentUser()
 | 
			
		||||
                                    .ModifyStatusAsync(mpp => mpp.Game = new Game(conf.RotatingStatusMessages[index++].Status))
 | 
			
		||||
                                    .ConfigureAwait(false);
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                        catch (Exception ex)
 | 
			
		||||
                        {
 | 
			
		||||
                            _log.Warn("Rotating playing status errored.\n" + ex);
 | 
			
		||||
                        }
 | 
			
		||||
                        finally
 | 
			
		||||
                        {
 | 
			
		||||
                            await Task.Delay(15000);
 | 
			
		||||
                        }
 | 
			
		||||
                    } while (true);
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            public static Dictionary<string, Func<string>> PlayingPlaceholders { get; } =
 | 
			
		||||
                new Dictionary<string, Func<string>> {
 | 
			
		||||
                    {"%servers%", () => NadekoBot.Client.GetGuilds().Count().ToString()},
 | 
			
		||||
@@ -45,28 +92,34 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
            {
 | 
			
		||||
                var channel = (ITextChannel)imsg.Channel;
 | 
			
		||||
 | 
			
		||||
                bool status;
 | 
			
		||||
                using (var uow = DbHandler.UnitOfWork())
 | 
			
		||||
                {
 | 
			
		||||
                    var config = uow.GuildConfigs.For(channel.Guild.Id);
 | 
			
		||||
                    var config = uow.BotConfig.GetOrCreate();
 | 
			
		||||
 | 
			
		||||
                    config.RotatingStatuses = !config.RotatingStatuses;
 | 
			
		||||
                    status = config.RotatingStatuses = !config.RotatingStatuses;
 | 
			
		||||
                    await uow.CompleteAsync();
 | 
			
		||||
                }
 | 
			
		||||
                if (status)
 | 
			
		||||
                    await channel.SendMessageAsync("`Rotating playing status enabled.`");
 | 
			
		||||
                else
 | 
			
		||||
                    await channel.SendMessageAsync("`Rotating playing status disabled.`");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            [LocalizedCommand, LocalizedDescription, LocalizedSummary]
 | 
			
		||||
            [RequireContext(ContextType.Guild)]
 | 
			
		||||
            public async Task AddPlaying(IMessage imsg, string status)
 | 
			
		||||
            public async Task AddPlaying(IMessage imsg, [Remainder] string status)
 | 
			
		||||
            {
 | 
			
		||||
                var channel = (ITextChannel)imsg.Channel;
 | 
			
		||||
 | 
			
		||||
                using (var uow = DbHandler.UnitOfWork())
 | 
			
		||||
                {
 | 
			
		||||
                    var config = uow.GuildConfigs.For(channel.Guild.Id);
 | 
			
		||||
                    var config = uow.BotConfig.GetOrCreate();
 | 
			
		||||
                    config.RotatingStatusMessages.Add(new PlayingStatus { Status = status });
 | 
			
		||||
                    await uow.CompleteAsync();
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                await channel.SendMessageAsync("`Added.`").ConfigureAwait(false);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            [LocalizedCommand, LocalizedDescription, LocalizedSummary]
 | 
			
		||||
@@ -78,7 +131,7 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
                List<PlayingStatus> statuses;
 | 
			
		||||
                using (var uow = DbHandler.UnitOfWork())
 | 
			
		||||
                {
 | 
			
		||||
                    statuses = uow.GuildConfigs.For(channel.Guild.Id).RotatingStatusMessages;
 | 
			
		||||
                    statuses = uow.BotConfig.GetOrCreate().RotatingStatusMessages;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (!statuses.Any())
 | 
			
		||||
@@ -86,7 +139,7 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    var i = 1;
 | 
			
		||||
                    await channel.SendMessageAsync($"{imsg.Author.Mention} Here is a list of rotating statuses:\n" + string.Join("\n", statuses.Select(rs => $"`{i++}.` {rs.Status}\n")));
 | 
			
		||||
                    await channel.SendMessageAsync($"{imsg.Author.Mention} `Here is a list of rotating statuses:`\n\n\t" + string.Join("\n\t", statuses.Select(rs => $"`{i++}.` {rs.Status}")));
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
@@ -96,17 +149,20 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
            public async Task RemovePlaying(IMessage imsg, int index)
 | 
			
		||||
            {
 | 
			
		||||
                var channel = (ITextChannel)imsg.Channel;
 | 
			
		||||
                index -= 1;
 | 
			
		||||
 | 
			
		||||
                string msg = "";
 | 
			
		||||
                using (var uow = DbHandler.UnitOfWork())
 | 
			
		||||
                {
 | 
			
		||||
                    var config = uow.GuildConfigs.For(channel.Guild.Id);
 | 
			
		||||
                    var config = uow.BotConfig.GetOrCreate();
 | 
			
		||||
 | 
			
		||||
                    if (index >= config.RotatingStatusMessages.Count)
 | 
			
		||||
                        return;
 | 
			
		||||
 | 
			
		||||
                    msg = config.RotatingStatusMessages[index].Status;
 | 
			
		||||
                    config.RotatingStatusMessages.RemoveAt(index);
 | 
			
		||||
                    await uow.CompleteAsync();
 | 
			
		||||
                }
 | 
			
		||||
                await channel.SendMessageAsync($"`Removed the the playing message:` {msg}").ConfigureAwait(false);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@@ -62,7 +62,7 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
                    success = uow.SelfAssignedRoles.DeleteByGuildAndRoleId(role.GuildId, role.Id);
 | 
			
		||||
                    await uow.CompleteAsync();
 | 
			
		||||
                }
 | 
			
		||||
                if (success)
 | 
			
		||||
                if (!success)
 | 
			
		||||
                {
 | 
			
		||||
                    await channel.SendMessageAsync(":anger:That role is not self-assignable.").ConfigureAwait(false);
 | 
			
		||||
                    return;
 | 
			
		||||
@@ -183,7 +183,7 @@ namespace NadekoBot.Modules.Administration
 | 
			
		||||
 | 
			
		||||
            [LocalizedCommand, LocalizedDescription, LocalizedSummary]
 | 
			
		||||
            [RequireContext(ContextType.Guild)]
 | 
			
		||||
            public async Task Iamnot(IMessage imsg, IRole role)
 | 
			
		||||
            public async Task Iamnot(IMessage imsg, [Remainder] IRole role)
 | 
			
		||||
            {
 | 
			
		||||
                var channel = (ITextChannel)imsg.Channel;
 | 
			
		||||
                var guildUser = (IGuildUser)imsg.Author;
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@ namespace NadekoBot.Modules.ClashOfClans
 | 
			
		||||
    {
 | 
			
		||||
        public static ConcurrentDictionary<ulong, List<ClashWar>> ClashWars { get; set; } = new ConcurrentDictionary<ulong, List<ClashWar>>();
 | 
			
		||||
 | 
			
		||||
        public ClashOfClans(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client) : base(loc, cmds, config, client)
 | 
			
		||||
        public ClashOfClans(ILocalization loc, CommandService cmds, DiscordSocketClient client) : base(loc, cmds, client)
 | 
			
		||||
        {
 | 
			
		||||
            using (var uow = DbHandler.UnitOfWork())
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
@@ -10,15 +10,13 @@ namespace NadekoBot.Modules
 | 
			
		||||
    {
 | 
			
		||||
        protected ILocalization _l;
 | 
			
		||||
        protected CommandService _commands;
 | 
			
		||||
        protected IBotConfiguration _config;
 | 
			
		||||
        protected DiscordSocketClient _client;
 | 
			
		||||
        protected Logger _log;
 | 
			
		||||
 | 
			
		||||
        public DiscordModule(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client)
 | 
			
		||||
        public DiscordModule(ILocalization loc, CommandService cmds, DiscordSocketClient client)
 | 
			
		||||
        {
 | 
			
		||||
            _l = loc;
 | 
			
		||||
            _commands = cmds;
 | 
			
		||||
            _config = config;
 | 
			
		||||
            _client = client;
 | 
			
		||||
            _log = LogManager.GetCurrentClassLogger();
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -2,6 +2,8 @@
 | 
			
		||||
using Discord.Commands;
 | 
			
		||||
using NadekoBot.Attributes;
 | 
			
		||||
using NadekoBot.Extensions;
 | 
			
		||||
using NadekoBot.Services;
 | 
			
		||||
using NadekoBot.Services.Database;
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Concurrent;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
@@ -63,7 +65,7 @@ namespace NadekoBot.Modules.Gambling
 | 
			
		||||
            public class AnimalRace
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
                private ConcurrentQueue<string> animals = new ConcurrentQueue<string>(NadekoBot.Config.RaceAnimals.Shuffle());
 | 
			
		||||
                private ConcurrentQueue<string> animals { get; }
 | 
			
		||||
 | 
			
		||||
                public bool Fail { get; internal set; }
 | 
			
		||||
 | 
			
		||||
@@ -83,6 +85,13 @@ namespace NadekoBot.Modules.Gambling
 | 
			
		||||
                        Fail = true;
 | 
			
		||||
                        return;
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    using (var uow = DbHandler.UnitOfWork())
 | 
			
		||||
                    {
 | 
			
		||||
                        animals = new ConcurrentQueue<string>(uow.BotConfig.GetOrCreate().RaceAnimals.Select(ra=>ra.Icon).Shuffle());
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                    var cancelSource = new CancellationTokenSource();
 | 
			
		||||
                    var token = cancelSource.Token;
 | 
			
		||||
                    var fullgame = CheckForFullGameAsync(token);
 | 
			
		||||
@@ -184,7 +193,7 @@ namespace NadekoBot.Modules.Gambling
 | 
			
		||||
                        var wonAmount = winner.AmountBet * (participants.Count - 1);
 | 
			
		||||
                        //todo DB
 | 
			
		||||
                        //await FlowersHandler.AddFlowersAsync(winner.User, "Won a Race", wonAmount).ConfigureAwait(false);
 | 
			
		||||
                        await raceChannel.SendMessageAsync($"🏁 {winner.User.Mention} as {winner.Animal} **Won the race and {wonAmount}{NadekoBot.Config.Currency.Sign}!**").ConfigureAwait(false);
 | 
			
		||||
                        await raceChannel.SendMessageAsync($"🏁 {winner.User.Mention} as {winner.Animal} **Won the race and {wonAmount}{CurrencySign}!**").ConfigureAwait(false);
 | 
			
		||||
                    }
 | 
			
		||||
                    else
 | 
			
		||||
                    {
 | 
			
		||||
@@ -228,7 +237,7 @@ namespace NadekoBot.Modules.Gambling
 | 
			
		||||
                        return false;
 | 
			
		||||
                    }
 | 
			
		||||
                    participants.Add(p);
 | 
			
		||||
                    await raceChannel.SendMessageAsync($"{u.Mention} **joined the race as a {p.Animal}" + (amount > 0 ? $" and bet {amount} {(amount == 1? NadekoBot.Config.Currency.Name: NadekoBot.Config.Currency.PluralName)}!**" : "**"));
 | 
			
		||||
                    await raceChannel.SendMessageAsync($"{u.Mention} **joined the race as a {p.Animal}" + (amount > 0 ? $" and bet {amount} {(amount == 1? CurrencyName : CurrencyPluralName)}!**" : "**"));
 | 
			
		||||
                    return true;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,7 @@ using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using NadekoBot.Services;
 | 
			
		||||
using Discord.WebSocket;
 | 
			
		||||
using NadekoBot.Services.Database;
 | 
			
		||||
 | 
			
		||||
//todo DB
 | 
			
		||||
namespace NadekoBot.Modules.Gambling
 | 
			
		||||
@@ -15,8 +16,21 @@ namespace NadekoBot.Modules.Gambling
 | 
			
		||||
    [Module("$", AppendSpace = false)]
 | 
			
		||||
    public partial class Gambling : DiscordModule
 | 
			
		||||
    {
 | 
			
		||||
        public Gambling(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client) : base(loc, cmds, config, client)
 | 
			
		||||
        public static string CurrencyName { get; set; }
 | 
			
		||||
        public static string CurrencyPluralName { get; set; }
 | 
			
		||||
        public static string CurrencySign { get; set; }
 | 
			
		||||
        
 | 
			
		||||
        public Gambling(ILocalization loc, CommandService cmds, DiscordSocketClient client) : base(loc, cmds, client)
 | 
			
		||||
        {
 | 
			
		||||
            using (var uow = DbHandler.UnitOfWork())
 | 
			
		||||
            {
 | 
			
		||||
                var conf = uow.BotConfig.GetOrCreate();
 | 
			
		||||
 | 
			
		||||
                CurrencyName = conf.CurrencyName;
 | 
			
		||||
                CurrencySign = conf.CurrencySign;
 | 
			
		||||
                CurrencyPluralName = conf.CurrencyPluralName;
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        [LocalizedCommand, LocalizedDescription, LocalizedSummary]
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,7 @@ using System.Linq;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using NadekoBot.Extensions;
 | 
			
		||||
using Discord.WebSocket;
 | 
			
		||||
using NadekoBot.Services.Database;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Modules.Games
 | 
			
		||||
{
 | 
			
		||||
@@ -15,10 +16,16 @@ namespace NadekoBot.Modules.Games
 | 
			
		||||
    public partial class Games : DiscordModule
 | 
			
		||||
    {
 | 
			
		||||
        //todo DB
 | 
			
		||||
        private IEnumerable<string> _8BallResponses;
 | 
			
		||||
        public Games(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client) : base(loc, cmds, config, client)
 | 
			
		||||
        private IEnumerable<string> _8BallResponses {
 | 
			
		||||
            get {
 | 
			
		||||
                using (var uow = DbHandler.UnitOfWork())
 | 
			
		||||
                {
 | 
			
		||||
                    return uow.BotConfig.GetOrCreate().EightBallResponses.Select(ebr => ebr.Text);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        public Games(ILocalization loc, CommandService cmds, DiscordSocketClient client) : base(loc, cmds, client)
 | 
			
		||||
        {
 | 
			
		||||
            _8BallResponses = config.EightBallResponses;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        [LocalizedCommand, LocalizedDescription, LocalizedSummary]
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@ namespace NadekoBot.Modules.Help
 | 
			
		||||
                return str + String.Format(str, NadekoBot.Credentials.ClientId);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        public Help(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client) : base(loc, cmds, config, client)
 | 
			
		||||
        public Help(ILocalization loc, CommandService cmds, DiscordSocketClient client) : base(loc, cmds, client)
 | 
			
		||||
        {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ namespace NadekoBot.Modules.Music
 | 
			
		||||
        public const string MusicDataPath = "data/musicdata";
 | 
			
		||||
        private IGoogleApiService _google;
 | 
			
		||||
 | 
			
		||||
        public Music(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client, IGoogleApiService google) : base(loc, cmds, config, client)
 | 
			
		||||
        public Music(ILocalization loc, CommandService cmds, DiscordSocketClient client, IGoogleApiService google) : base(loc, cmds, client)
 | 
			
		||||
        {
 | 
			
		||||
            //it can fail if its currenctly opened or doesn't exist. Either way i don't care
 | 
			
		||||
            try { Directory.Delete(MusicDataPath, true); } catch { }
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ namespace NadekoBot.Modules.NSFW
 | 
			
		||||
    [Module("~", AppendSpace = false)]
 | 
			
		||||
    public class NSFW : DiscordModule
 | 
			
		||||
    {
 | 
			
		||||
        public NSFW(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client) : base(loc, cmds, config, client)
 | 
			
		||||
        public NSFW(ILocalization loc, CommandService cmds, DiscordSocketClient client) : base(loc, cmds, client)
 | 
			
		||||
        {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ namespace NadekoBot.Modules.Games
 | 
			
		||||
    [Module(">", AppendSpace = false)]
 | 
			
		||||
    public partial class Pokemon : DiscordModule
 | 
			
		||||
    {
 | 
			
		||||
        public Pokemon(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client) : base(loc, cmds, config, client)
 | 
			
		||||
        public Pokemon(ILocalization loc, CommandService cmds, DiscordSocketClient client) : base(loc, cmds, client)
 | 
			
		||||
        {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@ namespace NadekoBot.Modules.Searches
 | 
			
		||||
    {
 | 
			
		||||
        private IGoogleApiService _google { get; }
 | 
			
		||||
 | 
			
		||||
        public Searches(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client, IGoogleApiService youtube) : base(loc, cmds, config, client)
 | 
			
		||||
        public Searches(ILocalization loc, CommandService cmds, DiscordSocketClient client, IGoogleApiService youtube) : base(loc, cmds, client)
 | 
			
		||||
        {
 | 
			
		||||
            _google = youtube;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,7 @@ namespace NadekoBot.Modules.Translator
 | 
			
		||||
    [Module("~", AppendSpace = false)]
 | 
			
		||||
    public class Translator : DiscordModule
 | 
			
		||||
    {
 | 
			
		||||
        public Translator(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client) : base(loc, cmds, config, client)
 | 
			
		||||
        public Translator(ILocalization loc, CommandService cmds, DiscordSocketClient client) : base(loc, cmds, client)
 | 
			
		||||
        {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -23,6 +23,8 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
            Regex regex = new Regex(@"^(?:(?<months>\d)mo)?(?:(?<weeks>\d)w)?(?:(?<days>\d{1,2})d)?(?:(?<hours>\d{1,2})h)?(?:(?<minutes>\d{1,2})m)?$",
 | 
			
		||||
                                    RegexOptions.Compiled | RegexOptions.Multiline);
 | 
			
		||||
 | 
			
		||||
            private string RemindMessageFormat { get; }
 | 
			
		||||
 | 
			
		||||
            IDictionary<string, Func<Reminder, string>> replacements = new Dictionary<string, Func<Reminder, string>>
 | 
			
		||||
            {
 | 
			
		||||
                { "%message%" , (r) => r.Message },
 | 
			
		||||
@@ -36,6 +38,8 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
                using (var uow = DbHandler.UnitOfWork())
 | 
			
		||||
                {
 | 
			
		||||
                    reminders = uow.Reminders.GetAll().ToList();
 | 
			
		||||
 | 
			
		||||
                    RemindMessageFormat = uow.BotConfig.GetOrCreate().RemindMessageFormat;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                foreach (var r in reminders)
 | 
			
		||||
@@ -74,7 +78,7 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
                        return;
 | 
			
		||||
 | 
			
		||||
                    await ch.SendMessageAsync(
 | 
			
		||||
                        replacements.Aggregate(NadekoBot.Config.RemindMessageFormat,
 | 
			
		||||
                        replacements.Aggregate(RemindMessageFormat,
 | 
			
		||||
                        (cur, replace) => cur.Replace(replace.Key, replace.Value(r)))
 | 
			
		||||
                            ).ConfigureAwait(false); //it works trust me
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
    [Module(".", AppendSpace = false)]
 | 
			
		||||
    public partial class Utility : DiscordModule
 | 
			
		||||
    {
 | 
			
		||||
        public Utility(ILocalization loc, CommandService cmds, IBotConfiguration config, DiscordSocketClient client) : base(loc, cmds, config, client)
 | 
			
		||||
        public Utility(ILocalization loc, CommandService cmds, DiscordSocketClient client) : base(loc, cmds, client)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
@@ -129,6 +129,19 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        [LocalizedCommand, LocalizedDescription, LocalizedSummary]
 | 
			
		||||
        [RequireContext(ContextType.Guild)]
 | 
			
		||||
        public async Task ChannelTopic(IMessage imsg)
 | 
			
		||||
        {
 | 
			
		||||
            var channel = (ITextChannel)imsg.Channel;
 | 
			
		||||
 | 
			
		||||
            var topic = channel.Topic;
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(topic))
 | 
			
		||||
                await channel.SendMessageAsync("`No topic set.`");
 | 
			
		||||
            else
 | 
			
		||||
                await channel.SendMessageAsync("`Topic:` " + topic);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        [LocalizedCommand, LocalizedDescription, LocalizedSummary]
 | 
			
		||||
        [RequireContext(ContextType.Guild)]
 | 
			
		||||
        public async Task Stats(IMessage imsg)
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,6 @@ namespace NadekoBot
 | 
			
		||||
 | 
			
		||||
        public static CommandService Commands { get; private set; }
 | 
			
		||||
        public static DiscordSocketClient Client { get; private set; }
 | 
			
		||||
        public static BotConfiguration Config { get; private set; }
 | 
			
		||||
        public static Localization Localizer { get; private set; }
 | 
			
		||||
        public static BotCredentials Credentials { get; private set; }
 | 
			
		||||
 | 
			
		||||
@@ -42,7 +41,6 @@ namespace NadekoBot
 | 
			
		||||
            //initialize Services
 | 
			
		||||
            Credentials = new BotCredentials();
 | 
			
		||||
            Commands = new CommandService();
 | 
			
		||||
            Config = new BotConfiguration();
 | 
			
		||||
            Localizer = new Localization();
 | 
			
		||||
            Google = new GoogleApiService();
 | 
			
		||||
            Stats = new StatsService(Client);
 | 
			
		||||
@@ -51,7 +49,6 @@ namespace NadekoBot
 | 
			
		||||
            //setup DI
 | 
			
		||||
            var depMap = new DependencyMap();
 | 
			
		||||
            depMap.Add<ILocalization>(Localizer);
 | 
			
		||||
            depMap.Add<IBotConfiguration>(Config);
 | 
			
		||||
            depMap.Add<DiscordSocketClient>(Client);
 | 
			
		||||
            depMap.Add<CommandService>(Commands);
 | 
			
		||||
            depMap.Add<IGoogleApiService>(Google);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										54
									
								
								src/NadekoBot/Resources/CommandStrings.Designer.cs
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										54
									
								
								src/NadekoBot/Resources/CommandStrings.Designer.cs
									
									
									
										generated
									
									
									
								
							@@ -6647,6 +6647,33 @@ namespace NadekoBot.Resources {
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        ///    Looks up a localized string similar to toggle whether the self-assigned roles should be exclusive.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public static string tesar_desc {
 | 
			
		||||
            get {
 | 
			
		||||
                return ResourceManager.GetString("tesar_desc", resourceCulture);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        ///    Looks up a localized string similar to `.tesar`.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public static string tesar_summary {
 | 
			
		||||
            get {
 | 
			
		||||
                return ResourceManager.GetString("tesar_summary", resourceCulture);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        ///    Looks up a localized string similar to tesar.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public static string tesar_text {
 | 
			
		||||
            get {
 | 
			
		||||
                return ResourceManager.GetString("tesar_text", resourceCulture);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        ///    Looks up a localized string similar to Shows a current trivia leaderboard..
 | 
			
		||||
        /// </summary>
 | 
			
		||||
@@ -6674,33 +6701,6 @@ namespace NadekoBot.Resources {
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        ///    Looks up a localized string similar to toggle whether the self-assigned roles should be exclusive.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public static string togglexclsar_desc {
 | 
			
		||||
            get {
 | 
			
		||||
                return ResourceManager.GetString("togglexclsar_desc", resourceCulture);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        ///    Looks up a localized string similar to `.tesar`.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public static string togglexclsar_summary {
 | 
			
		||||
            get {
 | 
			
		||||
                return ResourceManager.GetString("togglexclsar_summary", resourceCulture);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        ///    Looks up a localized string similar to togglexclsar.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public static string togglexclsar_text {
 | 
			
		||||
            get {
 | 
			
		||||
                return ResourceManager.GetString("togglexclsar_text", resourceCulture);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        ///    Looks up a localized string similar to Quits current trivia after current question..
 | 
			
		||||
        /// </summary>
 | 
			
		||||
 
 | 
			
		||||
@@ -405,13 +405,13 @@
 | 
			
		||||
  <data name="lsar_summary" xml:space="preserve">
 | 
			
		||||
    <value>`.lsar`</value>
 | 
			
		||||
  </data>
 | 
			
		||||
  <data name="togglexclsar_text" xml:space="preserve">
 | 
			
		||||
    <value>togglexclsar</value>
 | 
			
		||||
  <data name="tesar_text" xml:space="preserve">
 | 
			
		||||
    <value>tesar</value>
 | 
			
		||||
  </data>
 | 
			
		||||
  <data name="togglexclsar_desc" xml:space="preserve">
 | 
			
		||||
  <data name="tesar_desc" xml:space="preserve">
 | 
			
		||||
    <value>toggle whether the self-assigned roles should be exclusive</value>
 | 
			
		||||
  </data>
 | 
			
		||||
  <data name="togglexclsar_summary" xml:space="preserve">
 | 
			
		||||
  <data name="tesar_summary" xml:space="preserve">
 | 
			
		||||
    <value>`.tesar`</value>
 | 
			
		||||
  </data>
 | 
			
		||||
  <data name="iam_text" xml:space="preserve">
 | 
			
		||||
 
 | 
			
		||||
@@ -58,14 +58,5 @@ namespace NadekoBot.Resources {
 | 
			
		||||
                resourceCulture = value;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        ///    Looks up a localized string similar to TESTING.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public static string test {
 | 
			
		||||
            get {
 | 
			
		||||
                return ResourceManager.GetString("test", resourceCulture);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -117,7 +117,4 @@
 | 
			
		||||
  <resheader name="writer">
 | 
			
		||||
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
 | 
			
		||||
  </resheader>
 | 
			
		||||
  <data name="test" xml:space="preserve">
 | 
			
		||||
    <value>TESTING</value>
 | 
			
		||||
  </data>
 | 
			
		||||
</root>
 | 
			
		||||
@@ -15,6 +15,7 @@ namespace NadekoBot.Services.Database
 | 
			
		||||
        IClashOfClansRepository ClashOfClans { get; }
 | 
			
		||||
        IReminderRepository Reminders { get; }
 | 
			
		||||
        ISelfAssignedRolesRepository SelfAssignedRoles { get; }
 | 
			
		||||
        IBotConfigRepository BotConfig { get; }
 | 
			
		||||
 | 
			
		||||
        int Complete();
 | 
			
		||||
        Task<int> CompleteAsync();
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										115
									
								
								src/NadekoBot/Services/Database/Models/BotConfig.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										115
									
								
								src/NadekoBot/Services/Database/Models/BotConfig.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,115 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.ComponentModel.DataAnnotations.Schema;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Services.Database.Models
 | 
			
		||||
{
 | 
			
		||||
    public class BotConfig : DbEntity
 | 
			
		||||
    {
 | 
			
		||||
        public HashSet<BlacklistItem> Blacklist { get; set; }
 | 
			
		||||
        public ulong BufferSize { get; set; } = 4000000;
 | 
			
		||||
        public bool DontJoinServers { get; set; } = false;
 | 
			
		||||
        public bool ForwardMessages { get; set; } = true;
 | 
			
		||||
        public bool ForwardToAllOwners { get; set; } = true;
 | 
			
		||||
 | 
			
		||||
        public List<ModulePrefix> ModulePrefixes { get; set; } = new List<ModulePrefix>()
 | 
			
		||||
        {
 | 
			
		||||
           new ModulePrefix() { ModuleName="Administration", Prefix="." },
 | 
			
		||||
           new ModulePrefix() { ModuleName="Searches", Prefix="~" },
 | 
			
		||||
           new ModulePrefix() { ModuleName="NSFW", Prefix="~" },
 | 
			
		||||
           new ModulePrefix() { ModuleName="ClashOfClans", Prefix="," },
 | 
			
		||||
           new ModulePrefix() { ModuleName="Help", Prefix="-" },
 | 
			
		||||
           new ModulePrefix() { ModuleName="Music", Prefix="!!" },
 | 
			
		||||
           new ModulePrefix() { ModuleName="Trello", Prefix="trello" },
 | 
			
		||||
           new ModulePrefix() { ModuleName="Games", Prefix=">" },
 | 
			
		||||
           new ModulePrefix() { ModuleName="Gambling", Prefix="$" },
 | 
			
		||||
           new ModulePrefix() { ModuleName="Permissions", Prefix=";" },
 | 
			
		||||
           new ModulePrefix() { ModuleName="Pokemon", Prefix=">" },
 | 
			
		||||
           new ModulePrefix() { ModuleName="Utility", Prefix="." }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        public List<PlayingStatus> RotatingStatusMessages { get; set; } = new List<PlayingStatus>();
 | 
			
		||||
 | 
			
		||||
        public bool RotatingStatuses { get; set; } = false;
 | 
			
		||||
        public string RemindMessageFormat { get; set; } = "❗⏰**I've been told to remind you to '%message%' now by %user%.**⏰❗";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        public string CurrencySign { get; set; } = "🌸";
 | 
			
		||||
        public string CurrencyName { get; set; } = "Nadeko Flower";
 | 
			
		||||
        public string CurrencyPluralName { get; set; } = "Nadeko Flowers";
 | 
			
		||||
 | 
			
		||||
        public List<EightBallResponse> EightBallResponses { get; set; } = new List<EightBallResponse>
 | 
			
		||||
        {
 | 
			
		||||
            new EightBallResponse() { Text = "Most definitely yes" },
 | 
			
		||||
            new EightBallResponse() { Text = "For sure" },
 | 
			
		||||
            new EightBallResponse() { Text = "Totally!" },
 | 
			
		||||
            new EightBallResponse() { Text = "As I see it, yes" },
 | 
			
		||||
            new EightBallResponse() { Text = "My sources say yes" },
 | 
			
		||||
            new EightBallResponse() { Text = "Yes" },
 | 
			
		||||
            new EightBallResponse() { Text = "Most likely" },
 | 
			
		||||
            new EightBallResponse() { Text = "Perhaps" },
 | 
			
		||||
            new EightBallResponse() { Text = "Maybe" },
 | 
			
		||||
            new EightBallResponse() { Text = "Not sure" },
 | 
			
		||||
            new EightBallResponse() { Text = "It is uncertain" },
 | 
			
		||||
            new EightBallResponse() { Text = "Ask me again later" },
 | 
			
		||||
            new EightBallResponse() { Text = "Don't count on it" },
 | 
			
		||||
            new EightBallResponse() { Text = "Probably not" },
 | 
			
		||||
            new EightBallResponse() { Text = "Very doubtful" },
 | 
			
		||||
            new EightBallResponse() { Text = "Most likely no" },
 | 
			
		||||
            new EightBallResponse() { Text = "Nope" },
 | 
			
		||||
            new EightBallResponse() { Text = "No" },
 | 
			
		||||
            new EightBallResponse() { Text = "My sources say no" },
 | 
			
		||||
            new EightBallResponse() { Text = "Dont even think about it" },
 | 
			
		||||
            new EightBallResponse() { Text = "Definitely no" },
 | 
			
		||||
            new EightBallResponse() { Text = "NO - It may cause disease contraction" }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        public List<RaceAnimal> RaceAnimals { get; set; } = new List<RaceAnimal>
 | 
			
		||||
        {
 | 
			
		||||
            new RaceAnimal { Icon = "🐼", Name = "Panda" },
 | 
			
		||||
            new RaceAnimal { Icon = "🐻", Name = "Bear" },
 | 
			
		||||
            new RaceAnimal { Icon = "🐧", Name = "Pengu" },
 | 
			
		||||
            new RaceAnimal { Icon = "🐨", Name = "Koala" },
 | 
			
		||||
            new RaceAnimal { Icon = "🐬", Name = "Dolphin" },
 | 
			
		||||
            new RaceAnimal { Icon = "🐞", Name = "Ladybird" },
 | 
			
		||||
            new RaceAnimal { Icon = "🦀", Name = "Crab" },
 | 
			
		||||
            new RaceAnimal { Icon = "🦄", Name = "Unicorn" }
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class PlayingStatus :DbEntity
 | 
			
		||||
    {
 | 
			
		||||
        public string Status { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class BlacklistItem : DbEntity
 | 
			
		||||
    {
 | 
			
		||||
        public ulong ItemId { get; set; }
 | 
			
		||||
        public enum BlacklistType
 | 
			
		||||
        {
 | 
			
		||||
            Server,
 | 
			
		||||
            Channel,
 | 
			
		||||
            User
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class EightBallResponse : DbEntity
 | 
			
		||||
    {
 | 
			
		||||
        public string Text { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class RaceAnimal : DbEntity
 | 
			
		||||
    {
 | 
			
		||||
        public string Icon { get; set; }
 | 
			
		||||
        public string Name { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public class ModulePrefix : DbEntity
 | 
			
		||||
    {
 | 
			
		||||
        public string ModuleName { get; set; }
 | 
			
		||||
        public string Prefix { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -31,12 +31,5 @@ namespace NadekoBot.Services.Database.Models
 | 
			
		||||
        //self assignable roles
 | 
			
		||||
        public bool ExclusiveSelfAssignedRoles { get; set; }
 | 
			
		||||
        public bool AutoDeleteSelfAssignedRoleMessages { get; set; }
 | 
			
		||||
        public bool RotatingStatuses { get; set; }
 | 
			
		||||
        public List<PlayingStatus> RotatingStatusMessages { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class PlayingStatus : DbEntity
 | 
			
		||||
    {
 | 
			
		||||
        public string Status { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -17,6 +17,7 @@ namespace NadekoBot.Services.Database
 | 
			
		||||
        public DbSet<ClashCaller> ClashCallers { get; set; }
 | 
			
		||||
        public DbSet<Reminder> Reminders { get; set; }
 | 
			
		||||
        public DbSet<SelfAssignedRole> SelfAssignableRoles { get; set; }
 | 
			
		||||
        public DbSet<BotConfig> BotConfig { get; set; }
 | 
			
		||||
 | 
			
		||||
        protected override void OnModelCreating(ModelBuilder modelBuilder)
 | 
			
		||||
        {
 | 
			
		||||
@@ -25,8 +26,7 @@ namespace NadekoBot.Services.Database
 | 
			
		||||
            var quoteEntity = modelBuilder.Entity<Quote>();
 | 
			
		||||
 | 
			
		||||
            #endregion
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            
 | 
			
		||||
            #region Donators
 | 
			
		||||
 | 
			
		||||
            var donatorEntity = modelBuilder.Entity<Donator>();
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,14 @@
 | 
			
		||||
using NadekoBot.Services.Database.Models;
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Services.Database.Repositories
 | 
			
		||||
{
 | 
			
		||||
    public interface IBotConfigRepository : IRepository<BotConfig>
 | 
			
		||||
    {
 | 
			
		||||
        BotConfig GetOrCreate();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,34 @@
 | 
			
		||||
using NadekoBot.Services.Database.Models;
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Microsoft.EntityFrameworkCore;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Services.Database.Repositories.Impl
 | 
			
		||||
{
 | 
			
		||||
    public class BotConfigRepository : Repository<BotConfig>, IBotConfigRepository
 | 
			
		||||
    {
 | 
			
		||||
        public BotConfigRepository(DbContext context) : base(context)
 | 
			
		||||
        {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public BotConfig GetOrCreate()
 | 
			
		||||
        {
 | 
			
		||||
            var config = _set.Include(bc => bc.RotatingStatusMessages)
 | 
			
		||||
                             .Include(bc => bc.RaceAnimals)
 | 
			
		||||
                             .Include(bc => bc.Blacklist)
 | 
			
		||||
                             .Include(bc => bc.EightBallResponses)
 | 
			
		||||
                             .Include(bc => bc.ModulePrefixes)
 | 
			
		||||
                             .FirstOrDefault();
 | 
			
		||||
 | 
			
		||||
            if (config == null)
 | 
			
		||||
            {
 | 
			
		||||
                _set.Add(config = new BotConfig());
 | 
			
		||||
                _context.SaveChanges();
 | 
			
		||||
            }
 | 
			
		||||
            return config;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -26,6 +26,6 @@ namespace NadekoBot.Services.Database.Repositories.Impl
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public IEnumerable<SelfAssignedRole> GetFromGuild(ulong guildId) => 
 | 
			
		||||
            _set.Where(s => s.GuildId == guildId);
 | 
			
		||||
            _set.Where(s => s.GuildId == guildId).ToList();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -30,6 +30,9 @@ namespace NadekoBot.Services.Database
 | 
			
		||||
        private ISelfAssignedRolesRepository _selfAssignedRoles;
 | 
			
		||||
        public ISelfAssignedRolesRepository SelfAssignedRoles => _selfAssignedRoles ?? (_selfAssignedRoles = new SelfAssignedRolesRepository(_context));
 | 
			
		||||
 | 
			
		||||
        private IBotConfigRepository _botConfig;
 | 
			
		||||
        public IBotConfigRepository BotConfig => _botConfig ?? (_botConfig = new BotConfigRepository(_context));
 | 
			
		||||
 | 
			
		||||
        public UnitOfWork(NadekoContext context)
 | 
			
		||||
        {
 | 
			
		||||
            _context = context;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,52 +0,0 @@
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Services
 | 
			
		||||
{
 | 
			
		||||
    public interface IBotConfiguration
 | 
			
		||||
    {
 | 
			
		||||
        bool DontJoinServers { get; set; }
 | 
			
		||||
        bool ForwardMessages { get; set; }
 | 
			
		||||
        bool ForwardToAllOwners { get; set; }
 | 
			
		||||
 | 
			
		||||
        bool RotatePlayingStatus { get; set; }
 | 
			
		||||
        List<string> PlayingStatuses { get; set; }
 | 
			
		||||
 | 
			
		||||
        ulong BufferSize { get; set; }
 | 
			
		||||
        List<string> RaceAnimals { get; set; }
 | 
			
		||||
        string RemindMessageFormat { get; set; }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        HashSet<ulong> BlacklistedServers { get; set; }
 | 
			
		||||
        HashSet<ulong> BlacklistedChannels { get; set; }
 | 
			
		||||
        HashSet<ulong> BlacklistedUsers { get; set; }
 | 
			
		||||
 | 
			
		||||
        List<string> EightBallResponses { get; set; }       
 | 
			
		||||
        Currency Currency { get; set; }
 | 
			
		||||
 | 
			
		||||
        ModulePrefixes ModulePrefixes { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class Currency {
 | 
			
		||||
        public string Sign { get; set; }
 | 
			
		||||
        public string Name { get; set; }
 | 
			
		||||
        public string PluralName { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class ModulePrefixes
 | 
			
		||||
    {
 | 
			
		||||
        public string Administration { get; set; } = ".";
 | 
			
		||||
        public string Searches { get; set; } = "~";
 | 
			
		||||
        public string NSFW { get; set; } = "~";
 | 
			
		||||
        public string Conversations { get; set; } = "<@{0}>";
 | 
			
		||||
        public string ClashOfClans { get; set; } = ",";
 | 
			
		||||
        public string Help { get; set; } = "-";
 | 
			
		||||
        public string Music { get; set; } = "!!";
 | 
			
		||||
        public string Trello { get; set; } = "trello ";
 | 
			
		||||
        public string Games { get; set; } = ">";
 | 
			
		||||
        public string Gambling { get; set; } = "$";
 | 
			
		||||
        public string Permissions { get; set; } = ";";
 | 
			
		||||
        public string Programming { get; set; } = "%";
 | 
			
		||||
        public string Pokemon { get; set; } = ">";
 | 
			
		||||
        public string Utility { get; set; } = ".";
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,92 +0,0 @@
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Services.Impl
 | 
			
		||||
{
 | 
			
		||||
    public class BotConfiguration : IBotConfiguration
 | 
			
		||||
    {
 | 
			
		||||
        internal Task _8BallResponses;
 | 
			
		||||
 | 
			
		||||
        public HashSet<ulong> BlacklistedChannels { get; set; } = new HashSet<ulong>();
 | 
			
		||||
 | 
			
		||||
        public HashSet<ulong> BlacklistedServers { get; set; } = new HashSet<ulong>();
 | 
			
		||||
 | 
			
		||||
        public HashSet<ulong> BlacklistedUsers { get; set; } = new HashSet<ulong>();
 | 
			
		||||
 | 
			
		||||
        public ulong BufferSize { get; set; } = 4000000;
 | 
			
		||||
 | 
			
		||||
        public bool DontJoinServers { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
        public bool ForwardMessages { get; set; } = true;
 | 
			
		||||
 | 
			
		||||
        public bool ForwardToAllOwners { get; set; } = true;
 | 
			
		||||
 | 
			
		||||
        public ModulePrefixes ModulePrefixes { get; set; } = new ModulePrefixes
 | 
			
		||||
        {
 | 
			
		||||
            Administration = ".",
 | 
			
		||||
            ClashOfClans = ",",
 | 
			
		||||
            Conversations = "<@{0}>",
 | 
			
		||||
            Gambling = "$",
 | 
			
		||||
            Games = ">",
 | 
			
		||||
            Pokemon = ">",
 | 
			
		||||
            Help = "-",
 | 
			
		||||
            Music = "!!",
 | 
			
		||||
            NSFW = "~",
 | 
			
		||||
            Permissions = ";",
 | 
			
		||||
            Programming = "%",
 | 
			
		||||
            Searches = "~",
 | 
			
		||||
            Trello = "trello",
 | 
			
		||||
            Utility = "."
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        public List<string> PlayingStatuses { get; set; } = new List<string>();
 | 
			
		||||
 | 
			
		||||
        public string RemindMessageFormat { get; set; } = "❗⏰**I've been told to remind you to '%message%' now by %user%.**⏰❗";
 | 
			
		||||
 | 
			
		||||
        public bool RotatePlayingStatus { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
        public Currency Currency { get; set; } = new Currency
 | 
			
		||||
        {
 | 
			
		||||
            Name = "Nadeko Flower",
 | 
			
		||||
            PluralName = "Nadeko Flowers",
 | 
			
		||||
            Sign = "🌸",
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        public List<string> EightBallResponses { get; set; } = new List<string>
 | 
			
		||||
        {
 | 
			
		||||
            "Most definitely yes",
 | 
			
		||||
            "For sure",
 | 
			
		||||
            "As I see it, yes",
 | 
			
		||||
            "My sources say yes",
 | 
			
		||||
            "Yes",
 | 
			
		||||
            "Most likely",
 | 
			
		||||
            "Perhaps",
 | 
			
		||||
            "Maybe",
 | 
			
		||||
            "Not sure",
 | 
			
		||||
            "It is uncertain",
 | 
			
		||||
            "Ask me again later",
 | 
			
		||||
            "Don't count on it",
 | 
			
		||||
            "Probably not",
 | 
			
		||||
            "Very doubtful",
 | 
			
		||||
            "Most likely no",
 | 
			
		||||
            "Nope",
 | 
			
		||||
            "No",
 | 
			
		||||
            "My sources say no",
 | 
			
		||||
            "Dont even think about it",
 | 
			
		||||
            "Definitely no",
 | 
			
		||||
            "NO - It may cause disease contraction"
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        public List<string> RaceAnimals { get; set; } = new List<string>
 | 
			
		||||
        {
 | 
			
		||||
            "🐼",
 | 
			
		||||
            "🐻",
 | 
			
		||||
            "🐧",
 | 
			
		||||
            "🐨",
 | 
			
		||||
            "🐬",
 | 
			
		||||
            "🐞",
 | 
			
		||||
            "🦀",
 | 
			
		||||
            "🦄"
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -3161,7 +3161,7 @@
 | 
			
		||||
          "lib/portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10/libvideo.dll": {}
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      "Discord.Net/1.0.0-dev": {
 | 
			
		||||
      "Discord.Net/1.0.0-beta": {
 | 
			
		||||
        "type": "project",
 | 
			
		||||
        "framework": ".NETStandard,Version=v1.3",
 | 
			
		||||
        "dependencies": {
 | 
			
		||||
@@ -3188,7 +3188,7 @@
 | 
			
		||||
          "netstandard1.3/Discord.Net.dll": {}
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      "Discord.Net.Commands/1.0.0-dev": {
 | 
			
		||||
      "Discord.Net.Commands/1.0.0-beta": {
 | 
			
		||||
        "type": "project",
 | 
			
		||||
        "framework": ".NETStandard,Version=v1.3",
 | 
			
		||||
        "dependencies": {
 | 
			
		||||
@@ -9019,12 +9019,12 @@
 | 
			
		||||
        "lib/portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10/libvideo.dll"
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "Discord.Net/1.0.0-dev": {
 | 
			
		||||
    "Discord.Net/1.0.0-beta": {
 | 
			
		||||
      "type": "project",
 | 
			
		||||
      "path": "../../discord.net/src/Discord.Net/project.json",
 | 
			
		||||
      "msbuildProject": "../../discord.net/src/Discord.Net/Discord.Net.xproj"
 | 
			
		||||
    },
 | 
			
		||||
    "Discord.Net.Commands/1.0.0-dev": {
 | 
			
		||||
    "Discord.Net.Commands/1.0.0-beta": {
 | 
			
		||||
      "type": "project",
 | 
			
		||||
      "path": "../../discord.net/src/Discord.Net.Commands/project.json",
 | 
			
		||||
      "msbuildProject": "../../discord.net/src/Discord.Net.Commands/Discord.Net.Commands.xproj"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user