Fix for muted role change caching until bot restarts
This commit is contained in:
parent
dd01dba88d
commit
b106785ebc
|
@ -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())
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue