mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-19 16:33:36 +03:00
we do a little trolling
This commit is contained in:
parent
9429dfe8d8
commit
5bb94daff7
1 changed files with 60 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Octobot.Data;
|
using Octobot.Data;
|
||||||
|
@ -79,6 +80,12 @@ public class AboutCommandGroup : CommandGroup
|
||||||
var cfg = await _guildData.GetSettings(guildId, CancellationToken);
|
var cfg = await _guildData.GetSettings(guildId, CancellationToken);
|
||||||
Messages.Culture = GuildSettings.Language.Get(cfg);
|
Messages.Culture = GuildSettings.Language.Get(cfg);
|
||||||
|
|
||||||
|
var today = DateTime.Today;
|
||||||
|
if (today.Month is 4 && today.Day is 1)
|
||||||
|
{
|
||||||
|
return await SendNotAboutBotAsync(bot, CancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
return await SendAboutBotAsync(bot, guildId, CancellationToken);
|
return await SendAboutBotAsync(bot, guildId, CancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,4 +141,57 @@ public class AboutCommandGroup : CommandGroup
|
||||||
new ActionRowComponent(new[] { repositoryButton, wikiButton, issuesButton })
|
new ActionRowComponent(new[] { repositoryButton, wikiButton, issuesButton })
|
||||||
}), ct);
|
}), ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task<Result> SendNotAboutBotAsync(IUser bot, CancellationToken ct = default)
|
||||||
|
{
|
||||||
|
var builder = new StringBuilder().AppendLine("### maintainers");
|
||||||
|
builder.AppendBulletPointLine("@mctaylors — maintainer of the whole joke")
|
||||||
|
.AppendBulletPointLine("@Octol1ttle — Octobot developer")
|
||||||
|
.AppendBulletPointLine("@neroduckale — cool dude");
|
||||||
|
|
||||||
|
Color[] colors =
|
||||||
|
[
|
||||||
|
ColorsList.Red,
|
||||||
|
ColorsList.Green,
|
||||||
|
ColorsList.Yellow,
|
||||||
|
ColorsList.Blue,
|
||||||
|
ColorsList.Magenta
|
||||||
|
];
|
||||||
|
|
||||||
|
var embed = new EmbedBuilder()
|
||||||
|
.WithSmallTitle("about inkbot", bot)
|
||||||
|
.WithDescription(builder.ToString())
|
||||||
|
.WithColour(colors[Random.Shared.Next(colors.Length)])
|
||||||
|
.WithImageUrl("https://i.ibb.co/QPzXLxm/inkbot-banner.png")
|
||||||
|
.WithFooter($"foolish version: {BuildInfo.Version}")
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
var repositoryButton = new ButtonComponent(
|
||||||
|
ButtonComponentStyle.Link,
|
||||||
|
"inkbot's source code",
|
||||||
|
new PartialEmoji(Name: "🌐"),
|
||||||
|
URL: BuildInfo.RepositoryUrl
|
||||||
|
);
|
||||||
|
|
||||||
|
var wikiButton = new ButtonComponent(
|
||||||
|
ButtonComponentStyle.Link,
|
||||||
|
"open inkbot's wiki",
|
||||||
|
new PartialEmoji(Name: "📖"),
|
||||||
|
URL: BuildInfo.WikiUrl
|
||||||
|
);
|
||||||
|
|
||||||
|
var issuesButton = new ButtonComponent(
|
||||||
|
ButtonComponentStyle.Link,
|
||||||
|
"can't",
|
||||||
|
new PartialEmoji(Name: "\u26d4"),
|
||||||
|
URL: BuildInfo.IssuesUrl,
|
||||||
|
IsDisabled: true
|
||||||
|
);
|
||||||
|
|
||||||
|
return await _feedback.SendContextualEmbedResultAsync(embed,
|
||||||
|
new FeedbackMessageOptions(MessageComponents: new[]
|
||||||
|
{
|
||||||
|
new ActionRowComponent(new[] { repositoryButton, wikiButton, issuesButton })
|
||||||
|
}), ct);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue