Removed redundant parenthesis

This commit is contained in:
Kwoth
2021-12-20 03:54:30 +01:00
parent edd60ae656
commit 9223d78849
58 changed files with 147 additions and 147 deletions

View File

@@ -74,7 +74,7 @@ public partial class Xp
[NadekoCommand, Aliases]
public async Task ClubIcon([Leftover] string url = null)
{
if ((!Uri.IsWellFormedUriString(url, UriKind.Absolute) && url != null)
if (!Uri.IsWellFormedUriString(url, UriKind.Absolute) && url != null
|| !await _service.SetClubIcon(ctx.User.Id, url is null ? null : new Uri(url)))
{
await ReplyErrorLocalizedAsync(strs.club_icon_error).ConfigureAwait(false);

View File

@@ -294,7 +294,7 @@ public class ClubService : INService
if (usr is null)
return false;
if (club.OwnerId == usr.Id || (usr.IsClubAdmin && club.Owner.UserId != bannerId)) // can't ban the owner kek, whew
if (club.OwnerId == usr.Id || usr.IsClubAdmin && club.Owner.UserId != bannerId) // can't ban the owner kek, whew
return false;
club.Bans.Add(new()
@@ -345,7 +345,7 @@ public class ClubService : INService
if (usr is null)
return false;
if (club.OwnerId == usr.Id || (usr.IsClubAdmin && club.Owner.UserId != kickerId))
if (club.OwnerId == usr.Id || usr.IsClubAdmin && club.Owner.UserId != kickerId)
return false;
club.Users.Remove(usr);

View File

@@ -940,9 +940,9 @@ public class XpService : INService
//xp bar
if (_template.User.Xp.Bar.Show)
{
var xpPercent = (global.LevelXp / (float) global.RequiredXp);
var xpPercent = global.LevelXp / (float) global.RequiredXp;
DrawXpBar(xpPercent, _template.User.Xp.Bar.Global, img);
xpPercent = (guild.LevelXp / (float) guild.RequiredXp);
xpPercent = guild.LevelXp / (float) guild.RequiredXp;
DrawXpBar(xpPercent, _template.User.Xp.Bar.Guild, img);
}
@@ -970,7 +970,7 @@ public class XpService : INService
? "+ "
: "";
var awX = _template.User.Xp.Awarded.Pos.X -
(Math.Max(0, (stats.FullGuildStats.AwardedXp.ToString().Length - 2)) * 5);
Math.Max(0, stats.FullGuildStats.AwardedXp.ToString().Length - 2) * 5;
var awY = _template.User.Xp.Awarded.Pos.Y;
img.Mutate(x => x.DrawText($"({sign}{stats.FullGuildStats.AwardedXp})",
_fonts.NotoSans.CreateFont(_template.User.Xp.Awarded.FontSize, FontStyle.Bold),

View File

@@ -338,7 +338,7 @@ public partial class Xp : NadekoModule<XpService>
await ctx.Channel.TriggerTypingAsync();
var socketGuild = ((SocketGuild)ctx.Guild);
var socketGuild = (SocketGuild)ctx.Guild;
var allUsers = new List<UserXpStats>();
if (opts.Clean)
{
@@ -384,7 +384,7 @@ public partial class Xp : NadekoModule<XpService>
awardStr = $"({userXpData.AwardedXp})";
embed.AddField(
$"#{(i + 1 + curPage * 9)} {(user?.ToString() ?? users[i].UserId.ToString())}",
$"#{i + 1 + curPage * 9} {user?.ToString() ?? users[i].UserId.ToString()}",
$"{GetText(strs.level_x(levelStats.Level))} - {levelStats.TotalXp}xp {awardStr}");
}
return embed;
@@ -412,7 +412,7 @@ public partial class Xp : NadekoModule<XpService>
{
var user = users[i];
embed.AddField(
$"#{i + 1 + page * 9} {(user.ToString())}",
$"#{i + 1 + page * 9} {user.ToString()}",
$"{GetText(strs.level_x(new LevelStats(users[i].TotalXp).Level))} - {users[i].TotalXp}xp");
}
}