diff --git a/bot/functions.py b/bot/functions.py index f98b58a69..8bb373555 100644 --- a/bot/functions.py +++ b/bot/functions.py @@ -28,7 +28,9 @@ def saveBotsConfigs(): # loop on configuration helpers attached to the bot for guild in bot.guild_set.all(): var[guild.guildId] = dict({}) - var[guild.guildId]["name"] = guild.guildName + var[guild.guildId]["admin"] = {"name": guild.guildName, + "owner": guild.guildOwnerName, + "owner_id": guild.guildOwnerId} # manage channels if guild.manageChannels: @@ -49,7 +51,7 @@ def saveBotsConfigs(): var[guild.guildId]["stocks"]["channel"] = guild.stockChannel # chain - if guild.stockModule: + if guild.chainModule: var[guild.guildId]["chain"] = {"active": True} if guild.chainChannel: var[guild.guildId]["chain"]["channel"] = guild.chainChannel diff --git a/bot/migrations/0013_auto_20191215_1959.py b/bot/migrations/0013_auto_20191215_1959.py new file mode 100644 index 000000000..dfd13f502 --- /dev/null +++ b/bot/migrations/0013_auto_20191215_1959.py @@ -0,0 +1,23 @@ +# Generated by Django 2.2.7 on 2019-12-15 19:59 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bot', '0012_auto_20191214_1326'), + ] + + operations = [ + migrations.AddField( + model_name='guild', + name='guildOwnerId', + field=models.BigIntegerField(default=0), + ), + migrations.AddField( + model_name='guild', + name='guildOwnerName', + field=models.CharField(default='guild_owner', max_length=32), + ), + ] diff --git a/bot/models.py b/bot/models.py index 6e41452cd..35fd630b5 100644 --- a/bot/models.py +++ b/bot/models.py @@ -20,6 +20,8 @@ class Guild(models.Model): configuration = models.ForeignKey(DiscordApp, on_delete=models.CASCADE) guildId = models.BigIntegerField(default=0) guildName = models.CharField(default="guild_name", max_length=32) + guildOwnerId = models.BigIntegerField(default=0) + guildOwnerName = models.CharField(default="guild_owner", max_length=32) # general options manageChannels = models.BooleanField(default=False) diff --git a/templates/bot/apps.html b/templates/bot/apps.html index bf896fbb1..d0add2a3d 100644 --- a/templates/bot/apps.html +++ b/templates/bot/apps.html @@ -21,9 +21,9 @@
{% for k, v in options.items %}