1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

add /chat command

This commit is contained in:
Davran Dilshat 2021-09-04 19:42:14 +01:00
parent 9288ca1191
commit 4c006333e0

View File

@ -256,8 +256,21 @@ namespace osu.Game.Online.Chat
JoinChannel(channel);
break;
case "chat":
if (string.IsNullOrWhiteSpace(content))
{
target.AddNewMessages(new ErrorMessage("Usage: /chat [user]"));
break;
}
var request = new GetUserRequest(content);
request.Success += u => OpenPrivateChannel(u);
request.Failure += _ => target.AddNewMessages(new ErrorMessage("User not found."));
api.Queue(request);
break;
case "help":
target.AddNewMessages(new InfoMessage("Supported commands: /help, /me [action], /join [channel], /np"));
target.AddNewMessages(new InfoMessage("Supported commands: /help, /me [action], /join [channel], /chat [user], /np"));
break;
default: