From 163e2a94f600ffe0f982e3f605264ff2f2fe312b Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Fri, 9 Feb 2024 16:33:14 +0100 Subject: Apply syntax style to LibMatrix side projects --- Utilities/LibMatrix.Utilities.Bot/Commands/HelpCommand.cs | 8 +++----- Utilities/LibMatrix.Utilities.Bot/Commands/PingCommand.cs | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'Utilities/LibMatrix.Utilities.Bot/Commands') diff --git a/Utilities/LibMatrix.Utilities.Bot/Commands/HelpCommand.cs b/Utilities/LibMatrix.Utilities.Bot/Commands/HelpCommand.cs index 4fe1038..9937b3c 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Commands/HelpCommand.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Commands/HelpCommand.cs @@ -13,10 +13,8 @@ public class HelpCommand(IServiceProvider services) : ICommand { var sb = new StringBuilder(); sb.AppendLine("Available commands:"); var commands = services.GetServices().ToList(); - foreach (var command in commands) { - sb.AppendLine($"- {command.Name}: {command.Description}"); - } + foreach (var command in commands) sb.AppendLine($"- {command.Name}: {command.Description}"); - await ctx.Room.SendMessageEventAsync(new RoomMessageEventContent(messageType: "m.notice", body: sb.ToString())); + await ctx.Room.SendMessageEventAsync(new RoomMessageEventContent("m.notice", sb.ToString())); } -} +} \ No newline at end of file diff --git a/Utilities/LibMatrix.Utilities.Bot/Commands/PingCommand.cs b/Utilities/LibMatrix.Utilities.Bot/Commands/PingCommand.cs index 16712ea..b5fb868 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Commands/PingCommand.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Commands/PingCommand.cs @@ -7,7 +7,5 @@ public class PingCommand : ICommand { public string Name { get; } = "ping"; public string Description { get; } = "Pong!"; - public async Task Invoke(CommandContext ctx) { - await ctx.Room.SendMessageEventAsync(new RoomMessageEventContent(body: "pong!")); - } -} + public async Task Invoke(CommandContext ctx) => await ctx.Room.SendMessageEventAsync(new RoomMessageEventContent(body: "pong!")); +} \ No newline at end of file -- cgit 1.4.1