mirror of
https://gitlab.com/Deukhoofd/DeukBot4.git
synced 2026-04-03 11:10:05 +00:00
Silence user command, along with many improvements and bug fixes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using DeukBot4.Utilities;
|
||||
using System.Threading.Tasks;
|
||||
using DeukBot4.Utilities;
|
||||
using Npgsql;
|
||||
|
||||
namespace DeukBot4.Database.ServerSettings
|
||||
@@ -14,7 +15,7 @@ namespace DeukBot4.Database.ServerSettings
|
||||
public ulong ServerId { get; }
|
||||
public ulong MutedRoleId { get; }
|
||||
|
||||
public void SetMutedRoleId(ulong id)
|
||||
public async Task SetMutedRoleId(ulong id)
|
||||
{
|
||||
using (var conn = new DatabaseConnection())
|
||||
{
|
||||
@@ -24,7 +25,7 @@ namespace DeukBot4.Database.ServerSettings
|
||||
cmd.CommandText = "UPDATE server_settings SET muted_role = @val WHERE server_id = @key";
|
||||
cmd.Parameters.AddWithValue("val", id.ToLong());
|
||||
cmd.Parameters.AddWithValue("key", ServerId.ToLong());
|
||||
cmd.ExecuteNonQuery();
|
||||
await cmd.ExecuteNonQueryAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DeukBot4.Utilities;
|
||||
using Discord;
|
||||
using Npgsql;
|
||||
@@ -16,7 +17,7 @@ namespace DeukBot4.Database.ServerSettings
|
||||
using (var cmd = new NpgsqlCommand())
|
||||
{
|
||||
cmd.Connection = conn;
|
||||
cmd.CommandText = "SELECT server_id muted_role FROM server_settings";
|
||||
cmd.CommandText = "SELECT server_id, muted_role FROM server_settings";
|
||||
var reader = cmd.ExecuteReader();
|
||||
while (reader.Read())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user