private void OnUserChat(IPlayer player, string message) { if (!GetFeatureConfig <Configuration.Chat>(FeatureType.PlayerChat).Enabled) { return; } if (BetterChatMute?.Call <bool>("API_IsMuted", player) ?? false) { return; } if (AdminChat?.Call <bool>("HasAdminChatEnabled", player) ?? false) { return; } if (!player.HasPermission(AdminPermission)) { message = message.Replace("@everyone", "@ everyone").Replace("@here", "@ here"); } var chatConfig = GetFeatureConfig <Configuration.Chat>(FeatureType.PlayerChat); var discordMessage = $"[{DateTime.Now.ToShortTimeString()}] {GetLang("PlayerChatFormat", null, player.Name, message)}"; Request.Send(chatConfig.WebhookUrl, new FancyMessage().WithContent(discordMessage).AsTTS(chatConfig.TextToSpeech), this); // 변경 : 여기서 보내기 var serverMessage = $"{GetLang("PlayerChatFormat", null, player.Name, message)}"; SendToServer(serverMessage); }
private bool CheckMuteStatus(IPlayer player, IPlayer target) { if ((bool)BetterChatMute.CallHook("API_IsMuted", player)) { player.Reply(Lang("IsMuted", player.Id)); return(true); } if ((bool)BetterChatMute.CallHook("API_IsMuted", target)) { player.Reply(Lang("TargetMuted", player.Id)); return(true); } return(false); }
}//new timer event private object OnUserChat(IPlayer player, string message) { if (BetterChatMute != null) { bool?muted = BetterChatMute?.Call <bool>("API_IsMuted", player); if (muted.HasValue && muted.Value) { return(null); } } if (HangulInput != null) { message = (string)HangulInput?.Call("GetConvertedString", player.Id, message); } AddMsgOnJsonQueue(player.Name, message, false, false); return(null); }
private void OnUserChat(IPlayer player, string message) { int channel = 0; #endif if (!_init) { return; } if (BetterChatMute?.Call <bool>("API_IsMuted", player) ?? false) { return; } message = FilterText(message); if (HandlePluginSupport(player, message, MessageSource.Server, channel)) { return; } HandleChatMessage(player, message, channel); }