New command: FriendRequest
This commit is contained in:
parent
cf362de823
commit
6fc62c461f
1 changed files with 28 additions and 0 deletions
28
Core/Commands/Friends/FriendRequest.cs
Normal file
28
Core/Commands/Friends/FriendRequest.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
using System;
|
||||||
|
using OpenMetaverse;
|
||||||
|
namespace BSB.Commands.Movement
|
||||||
|
{
|
||||||
|
public class FriendRequest : CoreCommand_1arg
|
||||||
|
{
|
||||||
|
public override string[] ArgTypes { get { return new[] { "Avatar" }; } }
|
||||||
|
public override string[] ArgHints { get { return new[] { "Avatar UUID or Firstname Lastname" }; } }
|
||||||
|
public override string Helpfile { get { return "sends a friend request to the target avatar"; } }
|
||||||
|
public override bool CallFunction(string[] args)
|
||||||
|
{
|
||||||
|
if (base.CallFunction(args) == true)
|
||||||
|
{
|
||||||
|
if (UUID.TryParse(args[0], out UUID avatar) == true)
|
||||||
|
{
|
||||||
|
if (bot.GetClient.Friends.FriendList.ContainsKey(avatar) == false)
|
||||||
|
{
|
||||||
|
bot.GetClient.Friends.OfferFriendship(avatar);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return Failed("Unable to process avatar on arg 1");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue