- More code cleanup and codestyle updates

- Fixed some possible nullref exceptions
- Methods signatures now have up to 3 parameters before breakaing down each parameter in a separate line
- Method invocations have the same rule, except the first parameter will be in the same line as the invocation to prevent some ugliness when passing lambas as arguments
- Applied many more codestyles
- Extensions folder fully reformatted
This commit is contained in:
Kwoth
2021-12-26 17:28:39 +01:00
parent b85ba177cd
commit d5fd6aae8e
217 changed files with 1017 additions and 1494 deletions

View File

@@ -82,6 +82,7 @@ public class Help : NadekoModule<HelpService>
localModules
.OrderBy(module => module.Name)
.ToList()
.ForEach(module => embed.AddField($"{GetModuleEmoji(module.Name)} {module.Name}",
GetText(GetModuleLocStr(module.Name)) + "\n" +
Format.Code(GetText(strs.module_footer(Prefix, module.Name.ToLowerInvariant()))),
@@ -406,17 +407,13 @@ public class Help : NadekoModule<HelpService>
[NadekoCommand, Aliases]
public async Task Guide()
{
await ConfirmLocalizedAsync(strs.guide(
=> await ConfirmLocalizedAsync(strs.guide(
"https://nadeko.bot/commands",
"http://nadekobot.readthedocs.io/en/latest/"));
}
[NadekoCommand, Aliases]
public async Task Donate()
{
await ReplyConfirmLocalizedAsync(strs.donate(PatreonUrl, PaypalUrl));
}
=> await ReplyConfirmLocalizedAsync(strs.donate(PatreonUrl, PaypalUrl));
}
internal class CommandJsonObject

View File

@@ -154,16 +154,12 @@ public class HelpService : ILateExecutor, INService
}
public static string GetPreconditionString(ChannelPerm perm)
{
return (perm.ToString() + " Channel Permission")
=> (perm.ToString() + " Channel Permission")
.Replace("Guild", "Server", StringComparison.InvariantCulture);
}
public static string GetPreconditionString(GuildPerm perm)
{
return (perm.ToString() + " Server Permission")
=> (perm.ToString() + " Server Permission")
.Replace("Guild", "Server", StringComparison.InvariantCulture);
}
private string GetText(LocStr str, IGuild guild, params object[] replacements) =>
_strings.GetText(str, guild?.Id);