Files
Holocore/scripts/commands/generic/removeFriend.py
T
Waverunner 1ea6818c5c Fixed friends displaying in friends list from old characters
Fixed removeFriend command not properly lowercasing
Fixed variety of issues with the community window not refreshing friends list properly
Fixed empty "does not exist" messages for friends list
Fixed bug allowing you to add yourself to your friends list
2015-06-19 12:37:12 -04:00

23 lines
654 B
Python

from intents.chat import ChatBroadcastIntent
from resources.encodables import ProsePackage
from intents.chat import ChatAvatarRequestIntent
from intents.chat.ChatAvatarRequestIntent.RequestType import FRIEND_REMOVE_TARGET
def execute(galacticManager, player, target, args):
ghost = player.getPlayerObject()
if ghost is None or not args:
return
name = str(args.split(" ")[0]).lower()
if not name:
return
if ghost.getFriendsList().contains(name) is False:
ChatBroadcastIntent(player, ProsePackage("@cmnty:friend_not_found", "TT", name)).broadcast()
return
ChatAvatarRequestIntent(player, name, FRIEND_REMOVE_TARGET).broadcast()
return