Added QC Search, and fixed a few things with Guild Settings in regards to prefix usage, and bot boot up.

This commit is contained in:
Chris Darnell committed 2021-04-17 02:56:17 -07:00
1 parent 716ca9bf5e
commit b94573353d
3 files changed
+88 -15

No files matched your search

+12 -2
View File
@@ -85,7 +85,7 @@ namespace StarsiegeBot
{
int idnum = rnd.Next(Quickchats.Count);
chat = Quickchats[idnum];
msg.Content = idnum + ": " + chat.text;
msg.Content = $"[{idnum}] " + chat.text;
}
else
{
@@ -110,10 +110,20 @@ namespace StarsiegeBot
public async Task SearchQuickChats(CommandContext ctx, [RemainingText] string toSearch)
{
await ctx.TriggerTypingAsync();
DiscordMessageBuilder msg = new DiscordMessageBuilder();
msg.Content = "";
for (int i = 0; i < Quickchats.Count; i++)
{
if (Quickchats[i].text.ToLower().Contains(toSearch.ToLower()))
{
msg.Content += $"[{i}] {Quickchats[i].text}\r\n";
}
}
if (msg.Content == "")
{
msg.Content = "No results found.";
}
await ctx.RespondAsync(msg);
}
}
public class Quickchats