Skip to content

Commit

Permalink
adds attachment support to group notices
Browse files Browse the repository at this point in the history
  • Loading branch information
Madpeterz committed Oct 23, 2020
1 parent e40c3a5 commit 96d4d10
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Core/Commands/Group/GroupNotice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]<hr/>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]<hr/>if given 3 Args: Sends a group notice to [ARG 1] with the title [ARG 2] and the message [ARG 3]<br/>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)
Expand All @@ -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;
}
Expand Down

0 comments on commit 96d4d10

Please sign in to comment.