mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
vars and target-typed new
This commit is contained in:
@@ -133,9 +133,9 @@ public partial class Utility
|
||||
if (page < 0)
|
||||
return;
|
||||
|
||||
int startCount = page * activityPerPage;
|
||||
var startCount = page * activityPerPage;
|
||||
|
||||
StringBuilder str = new StringBuilder();
|
||||
var str = new StringBuilder();
|
||||
foreach (var kvp in CmdHandler.UserMessagesSent.OrderByDescending(kvp => kvp.Value).Skip(page * activityPerPage).Take(activityPerPage))
|
||||
{
|
||||
str.AppendLine(GetText(strs.activity_line(
|
||||
|
@@ -187,7 +187,7 @@ public partial class Utility
|
||||
var executesInString = Format.Bold(executesIn.ToPrettyStringHM());
|
||||
var message = Format.Sanitize(runner.Repeater.Message.TrimTo(50));
|
||||
|
||||
string description = "";
|
||||
var description = string.Empty;
|
||||
if (_service.IsNoRedundant(runner.Repeater.Id))
|
||||
{
|
||||
description = Format.Underline(Format.Bold(GetText(strs.no_redundant))) + "\n\n";
|
||||
|
@@ -67,7 +67,7 @@ public class CommandMapService : IInputTransformer, INService
|
||||
|
||||
if (guild != null)
|
||||
{
|
||||
if (AliasMaps.TryGetValue(guild.Id, out ConcurrentDictionary<string, string> maps))
|
||||
if (AliasMaps.TryGetValue(guild.Id, out var maps))
|
||||
{
|
||||
var keys = maps.Keys
|
||||
.OrderByDescending(x => x.Length);
|
||||
|
@@ -69,7 +69,7 @@ public class StreamRoleService : INService
|
||||
{
|
||||
userName.ThrowIfNull(nameof(userName));
|
||||
|
||||
bool success = false;
|
||||
var success = false;
|
||||
using (var uow = _db.GetDbContext())
|
||||
{
|
||||
var streamRoleSettings = uow.GetStreamRoleSettings(guild.Id);
|
||||
|
@@ -39,7 +39,7 @@ public partial class Utility
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task StreamRoleKeyword([Leftover]string keyword = null)
|
||||
{
|
||||
string kw = await this._service.SetKeyword(ctx.Guild, keyword).ConfigureAwait(false);
|
||||
var kw = await this._service.SetKeyword(ctx.Guild, keyword).ConfigureAwait(false);
|
||||
|
||||
if(string.IsNullOrWhiteSpace(keyword))
|
||||
await ReplyConfirmLocalizedAsync(strs.stream_role_kw_reset).ConfigureAwait(false);
|
||||
|
@@ -81,7 +81,7 @@ public partial class Utility : NadekoModule
|
||||
.Take(60)
|
||||
.ToArray()).ConfigureAwait(false);
|
||||
|
||||
int i = 0;
|
||||
var i = 0;
|
||||
if (arr.Length == 0)
|
||||
await ReplyErrorLocalizedAsync(strs.nobody_playing_game).ConfigureAwait(false);
|
||||
else
|
||||
@@ -140,7 +140,7 @@ public partial class Utility : NadekoModule
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task CheckPerms(MeOrBot who = MeOrBot.Me)
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
var builder = new StringBuilder();
|
||||
var user = who == MeOrBot.Me
|
||||
? (IGuildUser)ctx.User
|
||||
: ((SocketGuild)ctx.Guild).CurrentUser;
|
||||
|
Reference in New Issue
Block a user