chore: lint
This commit is contained in:
parent
ff70c26dae
commit
e2a6ee208b
@ -44,7 +44,7 @@ public class Random
|
|||||||
{
|
{
|
||||||
if (target == null)
|
if (target == null)
|
||||||
throw Errors.NoSystemError;
|
throw Errors.NoSystemError;
|
||||||
|
|
||||||
ctx.CheckSystemPrivacy(target.Id, target.GroupListPrivacy);
|
ctx.CheckSystemPrivacy(target.Id, target.GroupListPrivacy);
|
||||||
|
|
||||||
var groups = await ctx.Repository.GetSystemGroups(target.Id).ToListAsync();
|
var groups = await ctx.Repository.GetSystemGroups(target.Id).ToListAsync();
|
||||||
@ -55,8 +55,8 @@ public class Random
|
|||||||
|
|
||||||
if (groups == null || !groups.Any())
|
if (groups == null || !groups.Any())
|
||||||
throw new PKError(
|
throw new PKError(
|
||||||
ctx.System?.Id == target.Id ?
|
ctx.System?.Id == target.Id ?
|
||||||
"Your system has no groups! Please create at least one group before using this command." :
|
"Your system has no groups! Please create at least one group before using this command." :
|
||||||
$"This system has no groups!");
|
$"This system has no groups!");
|
||||||
|
|
||||||
var randInt = randGen.Next(groups.Count());
|
var randInt = randGen.Next(groups.Count());
|
||||||
@ -75,7 +75,7 @@ public class Random
|
|||||||
if (members == null || !members.Any())
|
if (members == null || !members.Any())
|
||||||
throw new PKError(
|
throw new PKError(
|
||||||
"This group has no members!"
|
"This group has no members!"
|
||||||
+ ( ctx.System?.Id == group.System ? " Please add at least one member to this group before using this command." : ""));
|
+ (ctx.System?.Id == group.System ? " Please add at least one member to this group before using this command." : ""));
|
||||||
|
|
||||||
if (!ctx.MatchFlag("all", "a"))
|
if (!ctx.MatchFlag("all", "a"))
|
||||||
members = members.Where(g => g.MemberVisibility == PrivacyLevel.Public);
|
members = members.Where(g => g.MemberVisibility == PrivacyLevel.Public);
|
||||||
|
@ -159,9 +159,10 @@ public class WebhookExecutorService
|
|||||||
var json = JsonConvert.DeserializeObject<JObject>(e.FormError);
|
var json = JsonConvert.DeserializeObject<JObject>(e.FormError);
|
||||||
var error = json.Value<JObject>("username").Value<JArray>("_errors").First.Value<string>("message");
|
var error = json.Value<JObject>("username").Value<JArray>("_errors").First.Value<string>("message");
|
||||||
|
|
||||||
await _rest.CreateMessage(req.ChannelId, new MessageRequest {
|
await _rest.CreateMessage(req.ChannelId, new MessageRequest
|
||||||
|
{
|
||||||
Content = $"{Emojis.Error} Discord rejected your proxy name: {error.AsCode()}",
|
Content = $"{Emojis.Error} Discord rejected your proxy name: {error.AsCode()}",
|
||||||
AllowedMentions = new AllowedMentions { Parse = {} },
|
AllowedMentions = new AllowedMentions { Parse = { } },
|
||||||
});
|
});
|
||||||
|
|
||||||
Sentry.SentrySdk.CaptureException(e);
|
Sentry.SentrySdk.CaptureException(e);
|
||||||
@ -183,9 +184,10 @@ public class WebhookExecutorService
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _rest.CreateMessage(req.ChannelId, new MessageRequest {
|
await _rest.CreateMessage(req.ChannelId, new MessageRequest
|
||||||
|
{
|
||||||
Content = $"{Emojis.Error} One or more of the files attached to this message were not able to be proxied because they were too large.",
|
Content = $"{Emojis.Error} One or more of the files attached to this message were not able to be proxied because they were too large.",
|
||||||
AllowedMentions = new AllowedMentions { Parse = {} },
|
AllowedMentions = new AllowedMentions { Parse = { } },
|
||||||
});
|
});
|
||||||
|
|
||||||
throw new ProxyService.ProxyChecksFailedException("_internal_discord_rejected_message");
|
throw new ProxyService.ProxyChecksFailedException("_internal_discord_rejected_message");
|
||||||
@ -304,7 +306,7 @@ public static class ProxyNameExt
|
|||||||
.FixDiscord()
|
.FixDiscord()
|
||||||
.FixBackticks()
|
.FixBackticks()
|
||||||
.FixSingleCharacterName();
|
.FixSingleCharacterName();
|
||||||
// .ThrowOnInvalidCharacters();
|
// .ThrowOnInvalidCharacters();
|
||||||
|
|
||||||
static string ThrowOnInvalidCharacters(this string name)
|
static string ThrowOnInvalidCharacters(this string name)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user