Fix some code style issues

This commit is contained in:
Daniel_I_Am 2020-08-30 12:05:33 +02:00
parent 2fb75190af
commit f8b37391cb
No known key found for this signature in database
GPG Key ID: 80C428FCC9743E84
9 changed files with 44 additions and 46 deletions

7
.editorconfig Normal file
View File

@ -0,0 +1,7 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4

View File

@ -136,9 +136,7 @@ namespace ChaosBot.Discord.Modules.User
$"{MethodBase.GetCurrentMethod().ReflectedType.FullName}: Exception [{ex}] thrown, <[{ex.Message}]>."); $"{MethodBase.GetCurrentMethod().ReflectedType.FullName}: Exception [{ex}] thrown, <[{ex.Message}]>.");
} }
await ReplyAsync($"{Context.User.Mention}, you have {cur} points.", false); await ReplyAsync($"{Context.User.Mention}, you have {cur} points.", false);
} }
public async Task RemPoints(SocketUser user = null, ulong Amount = 0) public async Task RemPoints(SocketUser user = null, ulong Amount = 0)
@ -217,7 +215,6 @@ namespace ChaosBot.Discord.Modules.User
await dbContext.Points.Upsert(usrPoint) await dbContext.Points.Upsert(usrPoint)
.On(x => new { x.DiscordGuildId, x.DiscordUserId}).RunAsync(); .On(x => new { x.DiscordGuildId, x.DiscordUserId}).RunAsync();
} }
await ReplyAsync( await ReplyAsync(
@ -267,7 +264,6 @@ namespace ChaosBot.Discord.Modules.User
await ReplyAsync( await ReplyAsync(
$"{Context.User.Mention} has given {user.Mention} {Amount} points for a total of {cur} points.", $"{Context.User.Mention} has given {user.Mention} {Amount} points for a total of {cur} points.",
false); false);
} }
else else
{ {

View File

@ -146,12 +146,10 @@ namespace ChaosBot.Discord.Modules.User
$"{MethodBase.GetCurrentMethod().ReflectedType.FullName}: Exception [{ex}] thrown, <[{ex.Message}]>."); $"{MethodBase.GetCurrentMethod().ReflectedType.FullName}: Exception [{ex}] thrown, <[{ex.Message}]>.");
} }
await ReplyAsync($"{Context.User.Mention}, you have {cur} raffle tickets.", false); await ReplyAsync($"{Context.User.Mention}, you have {cur} raffle tickets.", false);
} }
public async Task AddRaffle(SocketUser user = null, int Amount = 0, bool admin = false) public async Task AddRaffle(SocketUser user = null, int amount = 0, bool admin = false)
{ {
int cur = 0; int cur = 0;
try try
@ -162,7 +160,7 @@ namespace ChaosBot.Discord.Modules.User
{ {
IQueryable<Raffle> ctxRaffles = dbContext.Raffles; IQueryable<Raffle> ctxRaffles = dbContext.Raffles;
for (int i = 0; i < Amount; i++) for (int i = 0; i < amount; i++)
{ {
Raffle usrRaff = new Raffle(); Raffle usrRaff = new Raffle();
@ -181,7 +179,7 @@ namespace ChaosBot.Discord.Modules.User
} }
await ReplyAsync( await ReplyAsync(
$"{Context.User.Mention} has added {Amount} tickets to {user.Mention} for a total of {cur} tickets.", $"{Context.User.Mention} has added {amount} tickets to {user.Mention} for a total of {cur} tickets.",
false); false);
} }
} }

View File

@ -115,10 +115,7 @@ namespace ChaosBot.Discord.Services
.On(x => new {x.DiscordGuildId, x.DiscordUserId}).RunAsync(); .On(x => new {x.DiscordGuildId, x.DiscordUserId}).RunAsync();
} }
await user.Guild.SystemChannel.SendMessageAsync($"{user.Username} has joined the server."); await user.Guild.SystemChannel.SendMessageAsync($"{user.Username} has joined the server.");
} }
catch (Exception ex) catch (Exception ex)
{ {