Added in a way to have the bot message me (its owner.) Added in a sub-command on DeathMessage.

This commit is contained in:
Chris Darnell committed 2021-04-17 05:40:19 -07:00
1 parent b94573353d
commit 5ca7e5272f
3 files changed
+20 -4

No files matched your search

+9 -2
View File
@@ -22,6 +22,7 @@ namespace StarsiegeBot
{
class Program
{
public static DiscordMember notify;
public readonly EventId BotEventId = new EventId(42, "Bot-Ex04");
public DiscordClient Client { get; set; }
@@ -64,7 +65,7 @@ namespace StarsiegeBot
if (args.Length > 0)
BotName = args[0].ToLower();
else
BotName = "ssp";
BotName = "cybrid";
BotEventId = new EventId(276, BotName);
}
@@ -342,6 +343,7 @@ namespace StarsiegeBot
private Task Event_GuildAvailable(DiscordClient d, GuildCreateEventArgs e)
{
string gId = e.Guild.Id.ToString();
// this guild doesnt have settings, make a skel set for them.
if (!BotSettings.GuildSettings.ContainsKey(gId))
{
Console.WriteLine("making config");
@@ -356,10 +358,15 @@ namespace StarsiegeBot
item.LevelRoles = new Dictionary<string, int>();
item.Prefixes = new List<string>();
item.SelfRoles = new Dictionary<string, int>();
item.Prefixes.Add(">");
// this line... is a test line.
BotSettings.GuildSettings.Add(gId, item);
}
if (e.Guild.Id == 831348953097961534)
{
var mems = e.Guild.Members;
notify = mems[139548200099905536];
}
// let's log the name of the guild that was just
// sent to our client
d.Logger.LogInformation(BotEventId, $"Guild available: {e.Guild.Name}");
+11 -1
View File
@@ -19,6 +19,7 @@ using Microsoft.Extensions.Logging;
namespace StarsiegeBot
{
[Group("deathmessage"), Aliases("dm")]
[Description("Gives a random death message. Or interacts with the death messages.")]
class DeathMessages : BaseCommandModule
@@ -61,7 +62,7 @@ namespace StarsiegeBot
}
}
[Command("count")]
[Command("inventory"), Aliases("count")]
[Description("Gets the total of each type of death message")]
public async Task DeathMessageCount(CommandContext ctx)
{
@@ -69,6 +70,15 @@ namespace StarsiegeBot
await ctx.RespondAsync($"\r\nActive: {ActiveDeathMessages.Length}\r\nPassive: {PassiveDeathMessages.Length}\r\nGeneric: {GenericDeathMessages.Length}");
}
[Command("Add")]
public async Task DeathMessageNew(CommandContext ctx, [RemainingText] string str)
{
await ctx.TriggerTypingAsync();
await Program.notify.SendMessageAsync($"{ctx.Message.Author.Username} wantes to add the death messages. ```{str}```");
await ctx.RespondAsync("Your request has been added to the pending queue of requests.");
}
[Command("script")]
[Description("Gets a script file for all the death messages on the bot.")]
public async Task DeathMessagesScript(CommandContext ctx)
-1
View File
@@ -35,7 +35,6 @@ namespace StarsiegeBot
json = sr.ReadToEnd();
Dictionary<string, Quickchats> tempQC = JsonConvert.DeserializeObject<Dictionary<string, Quickchats>>(json);
Quickchats = Enumerable.ToList(tempQC.Values);
}
[Command("script")]