Added in a way to have the bot message me (its owner.) Added in a sub-command on DeathMessage.
This commit is contained in:
1 parent
b94573353d
commit
5ca7e5272f
3 files changed
+20
-4
No files matched your search
@@ -22,6 +22,7 @@ namespace StarsiegeBot
|
|||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
|
public static DiscordMember notify;
|
||||||
public readonly EventId BotEventId = new EventId(42, "Bot-Ex04");
|
public readonly EventId BotEventId = new EventId(42, "Bot-Ex04");
|
||||||
|
|
||||||
public DiscordClient Client { get; set; }
|
public DiscordClient Client { get; set; }
|
||||||
@@ -64,7 +65,7 @@ namespace StarsiegeBot
|
|||||||
if (args.Length > 0)
|
if (args.Length > 0)
|
||||||
BotName = args[0].ToLower();
|
BotName = args[0].ToLower();
|
||||||
else
|
else
|
||||||
BotName = "ssp";
|
BotName = "cybrid";
|
||||||
|
|
||||||
BotEventId = new EventId(276, BotName);
|
BotEventId = new EventId(276, BotName);
|
||||||
}
|
}
|
||||||
@@ -342,6 +343,7 @@ namespace StarsiegeBot
|
|||||||
private Task Event_GuildAvailable(DiscordClient d, GuildCreateEventArgs e)
|
private Task Event_GuildAvailable(DiscordClient d, GuildCreateEventArgs e)
|
||||||
{
|
{
|
||||||
string gId = e.Guild.Id.ToString();
|
string gId = e.Guild.Id.ToString();
|
||||||
|
// this guild doesnt have settings, make a skel set for them.
|
||||||
if (!BotSettings.GuildSettings.ContainsKey(gId))
|
if (!BotSettings.GuildSettings.ContainsKey(gId))
|
||||||
{
|
{
|
||||||
Console.WriteLine("making config");
|
Console.WriteLine("making config");
|
||||||
@@ -356,10 +358,15 @@ namespace StarsiegeBot
|
|||||||
item.LevelRoles = new Dictionary<string, int>();
|
item.LevelRoles = new Dictionary<string, int>();
|
||||||
item.Prefixes = new List<string>();
|
item.Prefixes = new List<string>();
|
||||||
item.SelfRoles = new Dictionary<string, int>();
|
item.SelfRoles = new Dictionary<string, int>();
|
||||||
item.Prefixes.Add(">");
|
|
||||||
// this line... is a test line.
|
// this line... is a test line.
|
||||||
BotSettings.GuildSettings.Add(gId, item);
|
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
|
// let's log the name of the guild that was just
|
||||||
// sent to our client
|
// sent to our client
|
||||||
d.Logger.LogInformation(BotEventId, $"Guild available: {e.Guild.Name}");
|
d.Logger.LogInformation(BotEventId, $"Guild available: {e.Guild.Name}");
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ using Microsoft.Extensions.Logging;
|
|||||||
|
|
||||||
namespace StarsiegeBot
|
namespace StarsiegeBot
|
||||||
{
|
{
|
||||||
|
|
||||||
[Group("deathmessage"), Aliases("dm")]
|
[Group("deathmessage"), Aliases("dm")]
|
||||||
[Description("Gives a random death message. Or interacts with the death messages.")]
|
[Description("Gives a random death message. Or interacts with the death messages.")]
|
||||||
class DeathMessages : BaseCommandModule
|
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")]
|
[Description("Gets the total of each type of death message")]
|
||||||
public async Task DeathMessageCount(CommandContext ctx)
|
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}");
|
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")]
|
[Command("script")]
|
||||||
[Description("Gets a script file for all the death messages on the bot.")]
|
[Description("Gets a script file for all the death messages on the bot.")]
|
||||||
public async Task DeathMessagesScript(CommandContext ctx)
|
public async Task DeathMessagesScript(CommandContext ctx)
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ namespace StarsiegeBot
|
|||||||
json = sr.ReadToEnd();
|
json = sr.ReadToEnd();
|
||||||
Dictionary<string, Quickchats> tempQC = JsonConvert.DeserializeObject<Dictionary<string, Quickchats>>(json);
|
Dictionary<string, Quickchats> tempQC = JsonConvert.DeserializeObject<Dictionary<string, Quickchats>>(json);
|
||||||
Quickchats = Enumerable.ToList(tempQC.Values);
|
Quickchats = Enumerable.ToList(tempQC.Values);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("script")]
|
[Command("script")]
|
||||||
|
|||||||
Reference in new issue
Block a user