mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
Removed redundant parenthesis
This commit is contained in:
@@ -60,7 +60,7 @@ public partial class Utility
|
||||
var embed = _eb.Create().WithOkColor();
|
||||
foreach (var inv in invites)
|
||||
{
|
||||
var expiryString = (inv.MaxAge is null || inv.MaxAge == 0 || inv.CreatedAt is null)
|
||||
var expiryString = inv.MaxAge is null || inv.MaxAge == 0 || inv.CreatedAt is null
|
||||
? "∞"
|
||||
: (inv.CreatedAt.Value.AddSeconds(inv.MaxAge.Value).UtcDateTime - DateTime.UtcNow)
|
||||
.ToString(@"d\.hh\:mm\:ss");
|
||||
|
@@ -36,7 +36,7 @@ public partial class Utility
|
||||
return;
|
||||
}
|
||||
|
||||
var rem = (_service.Interval - (DateTime.UtcNow - _service.LastUpdate));
|
||||
var rem = _service.Interval - (DateTime.UtcNow - _service.LastUpdate);
|
||||
var helpcmd = Format.Code(Prefix + "donate");
|
||||
await ctx.Channel.EmbedAsync(_eb.Create().WithOkColor()
|
||||
.WithDescription(GetText(strs.clpa_obsolete))
|
||||
|
@@ -213,7 +213,7 @@ public partial class Utility
|
||||
{
|
||||
var q = uow.Quotes.GetById(id);
|
||||
|
||||
if ((q?.GuildId != ctx.Guild.Id) || (!hasManageMessages && q.AuthorId != ctx.Message.Author.Id))
|
||||
if (q?.GuildId != ctx.Guild.Id || !hasManageMessages && q.AuthorId != ctx.Message.Author.Id)
|
||||
{
|
||||
response = GetText(strs.quotes_remove_none);
|
||||
}
|
||||
|
@@ -131,7 +131,7 @@ public partial class Utility
|
||||
var when = rem.When;
|
||||
var diff = when - DateTime.UtcNow;
|
||||
embed.AddField(
|
||||
$"#{++i + (page * 10)} {rem.When:HH:mm yyyy-MM-dd} UTC (in {(int) diff.TotalHours}h {(int) diff.Minutes}m)",
|
||||
$"#{++i + page * 10} {rem.When:HH:mm yyyy-MM-dd} UTC (in {(int) diff.TotalHours}h {(int) diff.Minutes}m)",
|
||||
$@"`Target:` {(rem.IsPrivate ? "DM" : "Channel")}
|
||||
`TargetId:` {rem.ChannelId}
|
||||
`Message:` {rem.Message?.TrimTo(50)}", false);
|
||||
|
@@ -116,8 +116,8 @@ public partial class Utility
|
||||
: TimeSpan.FromDays(1));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(message)
|
||||
|| (interval != null &&
|
||||
(interval.Time > TimeSpan.FromMinutes(25000) || interval.Time < TimeSpan.FromMinutes(1))))
|
||||
|| interval != null &&
|
||||
(interval.Time > TimeSpan.FromMinutes(25000) || interval.Time < TimeSpan.FromMinutes(1)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@ public sealed class RunningRepeater
|
||||
// interval (2.4h) * 0.834 is 2.0016 and that is the initial interval
|
||||
|
||||
var initialIntervalMultiplier = 1 - (triggerCount - Math.Truncate(triggerCount));
|
||||
return DateTime.UtcNow + (Repeater.Interval * initialIntervalMultiplier);
|
||||
return DateTime.UtcNow + Repeater.Interval * initialIntervalMultiplier;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
|
@@ -79,10 +79,10 @@ public partial class Utility
|
||||
{
|
||||
if (originUnit.UnitType == "currency")
|
||||
{
|
||||
res = (value * targetUnit.Modifier) / originUnit.Modifier;
|
||||
res = value * targetUnit.Modifier / originUnit.Modifier;
|
||||
}
|
||||
else
|
||||
res = (value * originUnit.Modifier) / targetUnit.Modifier;
|
||||
res = value * originUnit.Modifier / targetUnit.Modifier;
|
||||
}
|
||||
res = Math.Round(res, 4);
|
||||
|
||||
|
@@ -87,7 +87,7 @@ public partial class Utility : NadekoModule
|
||||
await ReplyErrorLocalizedAsync(strs.nobody_playing_game).ConfigureAwait(false);
|
||||
else
|
||||
{
|
||||
await SendConfirmAsync("```css\n" + string.Join("\n", arr.GroupBy(item => (i++) / 2)
|
||||
await SendConfirmAsync("```css\n" + string.Join("\n", arr.GroupBy(item => i++ / 2)
|
||||
.Select(ig => string.Concat(ig.Select(el => $"• {el,-27}")))) + "\n```")
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
@@ -348,7 +348,7 @@ public partial class Utility : NadekoModule
|
||||
if (page < 0)
|
||||
return;
|
||||
|
||||
var guilds = await Task.Run(() => _client.Guilds.OrderBy(g => g.Name).Skip((page) * 15).Take(15)).ConfigureAwait(false);
|
||||
var guilds = await Task.Run(() => _client.Guilds.OrderBy(g => g.Name).Skip(page * 15).Take(15)).ConfigureAwait(false);
|
||||
|
||||
if (!guilds.Any())
|
||||
{
|
||||
|
Reference in New Issue
Block a user