mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
add join command
This commit is contained in:
parent
d5be87c06a
commit
2f5d23b354
@ -213,8 +213,27 @@ namespace osu.Game.Online.Chat
|
||||
PostMessage(content, true);
|
||||
break;
|
||||
|
||||
case "j":
|
||||
case "join":
|
||||
if (string.IsNullOrWhiteSpace(content))
|
||||
{
|
||||
target.AddNewMessages(new ErrorMessage("Usage: /join [channel]"));
|
||||
break;
|
||||
}
|
||||
|
||||
var channel = availableChannels.Where(c => c.Name == content || c.Name == $"#{content}").FirstOrDefault();
|
||||
if (channel == null)
|
||||
{
|
||||
target.AddNewMessages(new ErrorMessage($"Channel '{content}' not found."));
|
||||
break;
|
||||
}
|
||||
|
||||
JoinChannel(channel);
|
||||
CurrentChannel.Value = channel;
|
||||
break;
|
||||
|
||||
case "help":
|
||||
target.AddNewMessages(new InfoMessage("Supported commands: /help, /me [action]"));
|
||||
target.AddNewMessages(new InfoMessage("Supported commands: /help, /me [action], /join [channel]"));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user