Add default values to guildsettings model
This commit is contained in:
parent
74619a4434
commit
d1e9992a8c
2 changed files with 15 additions and 15 deletions
|
@ -9,21 +9,21 @@ namespace Geekbot.net.Database.Models
|
|||
|
||||
[Required]
|
||||
public long GuildId { get; set; }
|
||||
|
||||
public bool Ping { get; set; }
|
||||
|
||||
public bool Hui { get; set; }
|
||||
|
||||
public long ModChannel { get; set; }
|
||||
|
||||
public bool Ping { get; set; } = false;
|
||||
|
||||
public bool Hui { get; set; } = false;
|
||||
|
||||
public long ModChannel { get; set; } = 0;
|
||||
|
||||
public string WelcomeMessage { get; set; }
|
||||
|
||||
public bool ShowDelete { get; set; }
|
||||
|
||||
public bool ShowLeave { get; set; }
|
||||
|
||||
public string WikiLang { get; set; }
|
||||
|
||||
public string Language { get; set; }
|
||||
|
||||
public bool ShowDelete { get; set; } = false;
|
||||
|
||||
public bool ShowLeave { get; set; } = false;
|
||||
|
||||
public string WikiLang { get; set; } = "en";
|
||||
|
||||
public string Language { get; set; } = "EN";
|
||||
}
|
||||
}
|
|
@ -184,7 +184,7 @@ namespace Geekbot.net
|
|||
{
|
||||
var guildSocketData = ((IGuildChannel) channel).Guild;
|
||||
var guild = _database.GuildSettings.FirstOrDefault(g => g.GuildId.Equals(guildSocketData.Id.AsLong()));
|
||||
if (guild?.ShowDelete ?? false)
|
||||
if ((guild?.ShowDelete ?? false) && guild?.ModChannel != 0)
|
||||
{
|
||||
var modChannelSocket = (ISocketMessageChannel) await _client.GetChannelAsync(guild.ModChannel.AsUlong());
|
||||
var sb = new StringBuilder();
|
||||
|
|
Loading…
Reference in a new issue