1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-19 16:33:36 +03:00

Added ColorsList.cs

This commit is contained in:
Macintxsh 2023-06-08 20:01:18 +03:00
parent c1179888d5
commit 4c31ebf826
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: CBB0BC4293CAF050
3 changed files with 27 additions and 14 deletions

15
ColorsList.cs Normal file
View file

@ -0,0 +1,15 @@
using System.Drawing;
namespace Boyfriend;
public static class ColorsList {
public static readonly Color Default = Color.Gray;
public static readonly Color Red = Color.Firebrick;
public static readonly Color Green = Color.PaleGreen;
public static readonly Color Yellow = Color.Gold;
public static readonly Color Blue = Color.RoyalBlue;
public static readonly Color Magneta = Color.Orchid;
public static readonly Color Cyan = Color.LightSkyBlue;
public static readonly Color Black = Color.Black;
public static readonly Color White = Color.WhiteSmoke;
}

View file

@ -1,5 +1,4 @@
using System.ComponentModel;
using System.Drawing;
using Boyfriend.Services;
using Boyfriend.Services.Data;
using Remora.Commands.Attributes;
@ -58,7 +57,7 @@ public class BanCommand : CommandGroup {
var existingBanResult = await _guildApi.GetGuildBanAsync(guildId.Value, target.ID, CancellationToken);
if (existingBanResult.IsDefined(out _)) {
var embed = new EmbedBuilder().WithSmallTitle(Messages.UserAlreadyBanned, currentUser)
.WithColour(Color.Firebrick).Build();
.WithColour(ColorsList.Red).Build();
if (!embed.IsDefined(out var alreadyBuilt))
return Result.FromError(embed);
@ -74,7 +73,7 @@ public class BanCommand : CommandGroup {
Result<Embed> responseEmbed;
if (interactionResult.Entity is not null) {
responseEmbed = new EmbedBuilder().WithSmallTitle(interactionResult.Entity, currentUser)
.WithColour(Color.Firebrick).Build();
.WithColour(ColorsList.Red).Build();
} else {
var userResult = await _userApi.GetUserAsync(userId.Value, CancellationToken);
if (!userResult.IsDefined(out var user))
@ -87,7 +86,7 @@ public class BanCommand : CommandGroup {
responseEmbed = new EmbedBuilder().WithSmallTitle(
string.Format(Messages.UserBanned, target.GetTag()), target)
.WithColour(Color.LawnGreen).Build();
.WithColour(ColorsList.Green).Build();
var cfg = await _dataService.GetConfiguration(guildId.Value, CancellationToken);
if ((cfg.PublicFeedbackChannel is not 0 && cfg.PublicFeedbackChannel != channelId.Value)
@ -97,7 +96,7 @@ public class BanCommand : CommandGroup {
.WithDescription(string.Format(Messages.DescriptionUserBanned, reason))
.WithActionFooter(user)
.WithCurrentTimestamp()
.WithColour(Color.Firebrick)
.WithColour(ColorsList.Red)
.Build();
if (!logEmbed.IsDefined(out var logBuilt))

View file

@ -1,4 +1,3 @@
using System.Drawing;
using System.Text;
using Boyfriend.Data;
using Boyfriend.Services.Data;
@ -60,7 +59,7 @@ public class GuildCreateResponder : IResponder<IGuildCreate> {
.WithDescription(Messages.Ready)
.WithUserFooter(currentUser)
.WithCurrentTimestamp()
.WithColour(Color.Aqua)
.WithColour(ColorsList.Blue)
.Build();
if (!embed.IsDefined(out var built)) return Result.FromError(embed);
@ -120,7 +119,7 @@ public class MessageDeletedResponder : IResponder<IMessageDelete> {
$"{Mention.Channel(gatewayEvent.ChannelID)}\n{Markdown.BlockCode(message.Content.SanitizeForBlockCode())}")
.WithActionFooter(user)
.WithTimestamp(message.Timestamp)
.WithColour(Color.Firebrick)
.WithColour(ColorsList.Red)
.Build();
if (!embed.IsDefined(out var built)) return Result.FromError(embed);
@ -190,7 +189,7 @@ public class MessageEditedResponder : IResponder<IMessageUpdate> {
.WithDescription($"https://discord.com/channels/{guildId}/{channelId}/{messageId}\n{diff.AsMarkdown()}")
.WithUserFooter(currentUser)
.WithTimestamp(timestamp.Value)
.WithColour(Color.Gold)
.WithColour(ColorsList.Yellow)
.Build();
if (!embed.IsDefined(out var built)) return Result.FromError(embed);
@ -234,7 +233,7 @@ public class GuildMemberAddResponder : IResponder<IGuildMemberAdd> {
.WithSmallTitle(string.Format(welcomeMessage, user.GetTag(), guild.Name), user)
.WithGuildFooter(guild)
.WithTimestamp(gatewayEvent.JoinedAt)
.WithColour(Color.LawnGreen)
.WithColour(ColorsList.Green)
.Build();
if (!embed.IsDefined(out var built)) return Result.FromError(embed);
@ -318,7 +317,7 @@ public class GuildScheduledEventCreateResponder : IResponder<IGuildScheduledEven
.WithEventCover(gatewayEvent.ID, gatewayEvent.Image)
.WithUserFooter(currentUser)
.WithCurrentTimestamp()
.WithColour(Color.Gray)
.WithColour(ColorsList.Default)
.Build();
if (!embed.IsDefined(out var built)) return Result.FromError(embed);
@ -414,7 +413,7 @@ public class GuildScheduledEventUpdateResponder : IResponder<IGuildScheduledEven
embed.WithTitle(string.Format(Messages.EventStarted, gatewayEvent.Name))
.WithDescription(embedDescription)
.WithCurrentTimestamp()
.WithColour(Color.LawnGreen);
.WithColour(ColorsList.Green);
break;
case GuildScheduledEventStatus.Completed:
embed.WithTitle(string.Format(Messages.EventCompleted, gatewayEvent.Name))
@ -424,7 +423,7 @@ public class GuildScheduledEventUpdateResponder : IResponder<IGuildScheduledEven
DateTimeOffset.UtcNow.Subtract(
guildData.ScheduledEvents[gatewayEvent.ID.Value].ActualStartTime
?? gatewayEvent.ScheduledStartTime).ToString()))
.WithColour(Color.Black);
.WithColour(ColorsList.Black);
guildData.ScheduledEvents.Remove(gatewayEvent.ID.Value);
break;
@ -462,7 +461,7 @@ public class GuildScheduledEventResponder : IResponder<IGuildScheduledEventDelet
var embed = new EmbedBuilder()
.WithSmallTitle(string.Format(Messages.EventCancelled, gatewayEvent.Name))
.WithDescription(":(")
.WithColour(Color.Firebrick)
.WithColour(ColorsList.Red)
.WithCurrentTimestamp()
.Build();