From e2a7bb654a0258ab5a36329a154c4f4a11334ed2 Mon Sep 17 00:00:00 2001 From: Rednir Date: Sat, 29 May 2021 18:15:40 +0100 Subject: [PATCH 1/6] update csproj --- wow2.Bot/wow2.Bot.csproj | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/wow2.Bot/wow2.Bot.csproj b/wow2.Bot/wow2.Bot.csproj index 67bdb973..98d6b6a5 100644 --- a/wow2.Bot/wow2.Bot.csproj +++ b/wow2.Bot/wow2.Bot.csproj @@ -5,19 +5,20 @@ ..\wow2.ruleset - - - - - - - + + + + + + + + - - + + - + \ No newline at end of file From 38fcab1f96c9d1d691c3fd889bf2345af15d0ebc Mon Sep 17 00:00:00 2001 From: Rednir Date: Sat, 29 May 2021 18:20:40 +0100 Subject: [PATCH 2/6] add issue link in about text --- wow2.Bot/Modules/Main/AboutMessage.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wow2.Bot/Modules/Main/AboutMessage.cs b/wow2.Bot/Modules/Main/AboutMessage.cs index 22ac07f6..b8dc096d 100644 --- a/wow2.Bot/Modules/Main/AboutMessage.cs +++ b/wow2.Bot/Modules/Main/AboutMessage.cs @@ -10,8 +10,8 @@ public AboutMessage(string commandPrefix = "!wow") var appInfo = BotService.ApplicationInfo; EmbedBuilder = new EmbedBuilder() { - Title = $"{appInfo.Name} • in {BotService.Client.Guilds.Count} servers", - Description = (string.IsNullOrWhiteSpace(appInfo.Description) ? null : appInfo.Description) + "\n[Link to github](https://github.com/rednir/wow2)", + Title = $"{appInfo.Name} / in {BotService.Client.Guilds.Count} servers", + Description = (string.IsNullOrWhiteSpace(appInfo.Description) ? null : appInfo.Description) + "\n[Link to github](https://github.com/rednir/wow2) • [Report an issue](https://github.com/rednir/wow2/issues/new/choose)", Color = Color.LightGrey, Author = new EmbedAuthorBuilder() { From 81f2803b921e4ac08be9efa0b807200a920ebd03 Mon Sep 17 00:00:00 2001 From: Rednir Date: Sun, 30 May 2021 11:19:46 +0100 Subject: [PATCH 3/6] use remainder attribute to prevent null input --- wow2.Bot/Modules/Osu/OsuModule.cs | 8 ++++---- wow2.Bot/Modules/Youtube/YoutubeModule.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wow2.Bot/Modules/Osu/OsuModule.cs b/wow2.Bot/Modules/Osu/OsuModule.cs index af973aec..502659ea 100644 --- a/wow2.Bot/Modules/Osu/OsuModule.cs +++ b/wow2.Bot/Modules/Osu/OsuModule.cs @@ -63,12 +63,12 @@ public static string MakeReadableModsList(IEnumerable mods) => [Command("user")] [Alias("player")] [Summary("Get some infomation about a user.")] - public async Task UserAsync([Name("USER")] params string[] userSplit) + public async Task UserAsync([Name("USER")] [Remainder] string userInput) { UserData userData; try { - userData = await GetUserAsync(string.Join(' ', userSplit)); + userData = await GetUserAsync(userInput.Trim('\"')); } catch (WebException) { @@ -82,12 +82,12 @@ public async Task UserAsync([Name("USER")] params string[] userSplit) [Command("subscribe")] [Alias("sub")] [Summary("Toggle whether your server will get notified about USER.")] - public async Task SubscribeAsync([Name("USER")] params string[] userSplit) + public async Task SubscribeAsync([Name("USER")] [Remainder] string userInput) { UserData userData; try { - userData = await GetUserAsync(string.Join(' ', userSplit)); + userData = await GetUserAsync(userInput.Trim('\"')); } catch (WebException) { diff --git a/wow2.Bot/Modules/Youtube/YoutubeModule.cs b/wow2.Bot/Modules/Youtube/YoutubeModule.cs index 74778381..12fa5068 100644 --- a/wow2.Bot/Modules/Youtube/YoutubeModule.cs +++ b/wow2.Bot/Modules/Youtube/YoutubeModule.cs @@ -114,12 +114,12 @@ public static async Task SearchForAsync(string term, string type) [Command("channel")] [Alias("user")] [Summary("Shows some basic data about a channel.")] - public async Task ChannelAsync([Name("CHANNEL")] params string[] userInputSplit) + public async Task ChannelAsync([Name("CHANNEL")] [Remainder] string userInput) { Channel channel; try { - channel = await GetChannelAsync(string.Join(' ', userInputSplit)); + channel = await GetChannelAsync(userInput.Trim('\"')); } catch (ArgumentException) { @@ -132,9 +132,9 @@ public async Task ChannelAsync([Name("CHANNEL")] params string[] userInputSplit) [Command("subscribe")] [Alias("sub")] [Summary("Toggle whether your server will get notified when CHANNEL uploads a new video.")] - public async Task SubscribeAsync([Name("CHANNEL")] params string[] userInputSplit) + public async Task SubscribeAsync([Name("CHANNEL")] [Remainder] string userInput) { - var channel = await GetChannelAsync(string.Join(' ', userInputSplit)); + var channel = await GetChannelAsync(userInput.Trim('\"')); if (Config.SubscribedChannels.RemoveAll(ch => ch.Id == channel.Id) != 0) { From 96093147b3773fa2161c6d874d9c2e0600b75efe Mon Sep 17 00:00:00 2001 From: Rednir Date: Sun, 30 May 2021 11:21:44 +0100 Subject: [PATCH 4/6] fix commit to wrong branch From e6af65eff20163d4015d5debafeaf21ee44d6e13 Mon Sep 17 00:00:00 2001 From: Rednir Date: Sun, 30 May 2021 11:23:01 +0100 Subject: [PATCH 5/6] Revert "use remainder attribute to prevent null input" This reverts commit 81f2803b921e4ac08be9efa0b807200a920ebd03. --- wow2.Bot/Modules/Osu/OsuModule.cs | 8 ++++---- wow2.Bot/Modules/Youtube/YoutubeModule.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wow2.Bot/Modules/Osu/OsuModule.cs b/wow2.Bot/Modules/Osu/OsuModule.cs index 502659ea..af973aec 100644 --- a/wow2.Bot/Modules/Osu/OsuModule.cs +++ b/wow2.Bot/Modules/Osu/OsuModule.cs @@ -63,12 +63,12 @@ public static string MakeReadableModsList(IEnumerable mods) => [Command("user")] [Alias("player")] [Summary("Get some infomation about a user.")] - public async Task UserAsync([Name("USER")] [Remainder] string userInput) + public async Task UserAsync([Name("USER")] params string[] userSplit) { UserData userData; try { - userData = await GetUserAsync(userInput.Trim('\"')); + userData = await GetUserAsync(string.Join(' ', userSplit)); } catch (WebException) { @@ -82,12 +82,12 @@ public async Task UserAsync([Name("USER")] [Remainder] string userInput) [Command("subscribe")] [Alias("sub")] [Summary("Toggle whether your server will get notified about USER.")] - public async Task SubscribeAsync([Name("USER")] [Remainder] string userInput) + public async Task SubscribeAsync([Name("USER")] params string[] userSplit) { UserData userData; try { - userData = await GetUserAsync(userInput.Trim('\"')); + userData = await GetUserAsync(string.Join(' ', userSplit)); } catch (WebException) { diff --git a/wow2.Bot/Modules/Youtube/YoutubeModule.cs b/wow2.Bot/Modules/Youtube/YoutubeModule.cs index 12fa5068..74778381 100644 --- a/wow2.Bot/Modules/Youtube/YoutubeModule.cs +++ b/wow2.Bot/Modules/Youtube/YoutubeModule.cs @@ -114,12 +114,12 @@ public static async Task SearchForAsync(string term, string type) [Command("channel")] [Alias("user")] [Summary("Shows some basic data about a channel.")] - public async Task ChannelAsync([Name("CHANNEL")] [Remainder] string userInput) + public async Task ChannelAsync([Name("CHANNEL")] params string[] userInputSplit) { Channel channel; try { - channel = await GetChannelAsync(userInput.Trim('\"')); + channel = await GetChannelAsync(string.Join(' ', userInputSplit)); } catch (ArgumentException) { @@ -132,9 +132,9 @@ public async Task ChannelAsync([Name("CHANNEL")] [Remainder] string userInput) [Command("subscribe")] [Alias("sub")] [Summary("Toggle whether your server will get notified when CHANNEL uploads a new video.")] - public async Task SubscribeAsync([Name("CHANNEL")] [Remainder] string userInput) + public async Task SubscribeAsync([Name("CHANNEL")] params string[] userInputSplit) { - var channel = await GetChannelAsync(userInput.Trim('\"')); + var channel = await GetChannelAsync(string.Join(' ', userInputSplit)); if (Config.SubscribedChannels.RemoveAll(ch => ch.Id == channel.Id) != 0) { From 1c48e49b2c766d0058bef587112fc81d03ef366e Mon Sep 17 00:00:00 2001 From: Rednir Date: Sun, 30 May 2021 11:23:21 +0100 Subject: [PATCH 6/6] Revert "add issue link in about text" This reverts commit 38fcab1f96c9d1d691c3fd889bf2345af15d0ebc. --- wow2.Bot/Modules/Main/AboutMessage.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wow2.Bot/Modules/Main/AboutMessage.cs b/wow2.Bot/Modules/Main/AboutMessage.cs index b8dc096d..22ac07f6 100644 --- a/wow2.Bot/Modules/Main/AboutMessage.cs +++ b/wow2.Bot/Modules/Main/AboutMessage.cs @@ -10,8 +10,8 @@ public AboutMessage(string commandPrefix = "!wow") var appInfo = BotService.ApplicationInfo; EmbedBuilder = new EmbedBuilder() { - Title = $"{appInfo.Name} / in {BotService.Client.Guilds.Count} servers", - Description = (string.IsNullOrWhiteSpace(appInfo.Description) ? null : appInfo.Description) + "\n[Link to github](https://github.com/rednir/wow2) • [Report an issue](https://github.com/rednir/wow2/issues/new/choose)", + Title = $"{appInfo.Name} • in {BotService.Client.Guilds.Count} servers", + Description = (string.IsNullOrWhiteSpace(appInfo.Description) ? null : appInfo.Description) + "\n[Link to github](https://github.com/rednir/wow2)", Color = Color.LightGrey, Author = new EmbedAuthorBuilder() {