From 96d4d1080e373188918635eb3d57afa739c4a371 Mon Sep 17 00:00:00 2001 From: Madpeter Date: Fri, 23 Oct 2020 18:17:13 +0100 Subject: [PATCH] adds attachment support to group notices --- Core/Commands/Group/GroupNotice.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Core/Commands/Group/GroupNotice.cs b/Core/Commands/Group/GroupNotice.cs index e8100f7..9fafeb0 100644 --- a/Core/Commands/Group/GroupNotice.cs +++ b/Core/Commands/Group/GroupNotice.cs @@ -5,9 +5,9 @@ namespace BSB.Commands.Group { class Groupnotice : CoreCommand_2arg { - public override string[] ArgTypes { get { return new[] { "UUID", "TEXT","TEXT" }; } } - public override string[] ArgHints { get { return new[] { "Group", "Message/Title", "Message" }; } } - public override string Helpfile { get { return "Sends a group notice to [ARG 1] with the message [ARG 2]
if given 3 Args: Sends a group notice to [ARG 1] with the title [ARG 2] and the message [ARG 3]"; } } + public override string[] ArgTypes { get { return new[] { "UUID", "TEXT","TEXT","TEXT" }; } } + public override string[] ArgHints { get { return new[] { "Group", "Message/Title", "Message","Inventory UUID" }; } } + public override string Helpfile { get { return "Sends a group notice to [ARG 1] with the message [ARG 2]
if given 3 Args: Sends a group notice to [ARG 1] with the title [ARG 2] and the message [ARG 3]
if [ARG 4] is given then it also sends the notice with an attachment"; } } public override bool CallFunction(string[] args) { if (base.CallFunction(args) == true) @@ -27,6 +27,13 @@ public override bool CallFunction(string[] args) NewNotice.Subject = Noticetitle; NewNotice.Message = Noticemessage; NewNotice.OwnerID = bot.GetClient.Self.AgentID; + if (args.Length == 4) + { + if (UUID.TryParse(args[3], out UUID result) == true) + { + NewNotice.AttachmentID = result; + } + } bot.GetClient.Groups.SendGroupNotice(targetgroup, NewNotice); return true; }