Fix for muted role change caching until bot restarts

This commit is contained in:
Deukhoofd 2018-04-30 19:14:41 +02:00
parent dd01dba88d
commit b106785ebc
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
2 changed files with 3 additions and 2 deletions

View File

@ -13,10 +13,11 @@ namespace DeukBot4.Database.ServerSettings
} }
public ulong ServerId { get; } public ulong ServerId { get; }
public ulong MutedRoleId { get; } public ulong MutedRoleId { get; private set; }
public async Task SetMutedRoleId(ulong id) public async Task SetMutedRoleId(ulong id)
{ {
MutedRoleId = id;
using (var conn = new DatabaseConnection()) using (var conn = new DatabaseConnection())
{ {
using (var cmd = new NpgsqlCommand()) using (var cmd = new NpgsqlCommand())

View File

@ -7,7 +7,7 @@ namespace DeukBot4.Utilities
public static string RemoveSpecialCharacters(this string str) { public static string RemoveSpecialCharacters(this string str) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
foreach (char c in str) { foreach (char c in str) {
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) { if (char.IsLetterOrDigit(c) || char.IsWhiteSpace(c)) {
sb.Append(c); sb.Append(c);
} }
} }