about summary refs log tree commit diff
path: root/Utilities/LibMatrix.DevTestBot/Bot/Commands/DbgAniRainbowTest.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-05 00:58:08 +0100
committerRory& <root@rory.gay>2025-12-05 00:58:08 +0100
commit741cc856e3546828bc127da03166067eb2053f43 (patch)
tree17bb8e7a07f1b895fa583b38fd2364a17bd26ae5 /Utilities/LibMatrix.DevTestBot/Bot/Commands/DbgAniRainbowTest.cs
parentEvent content redaction (v12) (diff)
downloadLibMatrix-741cc856e3546828bc127da03166067eb2053f43.tar.xz
Drop dev test bot
Diffstat (limited to 'Utilities/LibMatrix.DevTestBot/Bot/Commands/DbgAniRainbowTest.cs')
-rw-r--r--Utilities/LibMatrix.DevTestBot/Bot/Commands/DbgAniRainbowTest.cs53
1 files changed, 0 insertions, 53 deletions
diff --git a/Utilities/LibMatrix.DevTestBot/Bot/Commands/DbgAniRainbowTest.cs b/Utilities/LibMatrix.DevTestBot/Bot/Commands/DbgAniRainbowTest.cs
deleted file mode 100644

index 0dde297..0000000 --- a/Utilities/LibMatrix.DevTestBot/Bot/Commands/DbgAniRainbowTest.cs +++ /dev/null
@@ -1,53 +0,0 @@ -using System.Diagnostics; -using LibMatrix.EventTypes.Spec; -using LibMatrix.Helpers; -using LibMatrix.Services; -using LibMatrix.Utilities.Bot.Interfaces; - -namespace ModerationBot.Commands; - -public class DbgAniRainbowTest(IServiceProvider services, HomeserverProviderService hsProvider, HomeserverResolverService hsResolver) : ICommand { - public string Name { get; } = "ani-rainbow"; - - public string[]? Aliases => []; - public bool Unlisted => false; - - public string Description { get; } = "[Debug] animated rainbow :)"; - - - public async Task<bool> CanInvoke(CommandContext ctx) => ctx.Room.RoomId == "!hLEefBaYvNfJwcTjmt:rory.gay"; - - public async Task Invoke(CommandContext ctx) { - //255 long string - // var rainbow = "🟥🟧🟨🟩🟦🟪"; - var rainbow = "M"; - var chars = rainbow; - for (var i = 0; i < 76; i++) chars += rainbow[i % rainbow.Length]; - - Task.Run(async () => { - var i = 0; - var msg = new MessageBuilder("m.notice").WithRainbowString(chars).Build(); - var msgEvent = await ctx.Room.SendMessageEventAsync(msg); - - while (true) { - msg = new MessageBuilder("m.notice").WithRainbowString(chars, offset: i * 5).Build(); - if (i % 50 == 0) { - msg.NewContent = null; - msg.RelatesTo = null; - msgEvent = await ctx.Room.SendMessageEventAsync(msg); - } - else { - msg = msg.SetReplaceRelation<RoomMessageEventContent>(msgEvent.EventId); - msg.Body = ""; - msg.FormattedBody = ""; - } - - var sw = Stopwatch.StartNew(); - await - ctx.Room.SendMessageEventAsync(msg); - await Task.Delay(sw.Elapsed); - i++; - } - }); - } -} \ No newline at end of file