本文整理匯總了C#中Winter.WinterBot.TimeoutMessage方法的典型用法代碼示例。如果您正苦於以下問題:C# WinterBot.TimeoutMessage方法的具體用法?C# WinterBot.TimeoutMessage怎麽用?C# WinterBot.TimeoutMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Winter.WinterBot
的用法示例。
在下文中一共展示了WinterBot.TimeoutMessage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CheckMessage
public void CheckMessage(WinterBot bot, TwitchUser user, string text)
{
if (user.IsModerator)
return;
string clearReason = null;
List<string> urls;
if (HasUrls(text, out urls))
{
// Check bans.
if (MatchesAny(urls, m_urlBanlist))
{
m_winterBot.Ban(user);
if (!string.IsNullOrEmpty(m_urlOptions.BanMessage))
bot.TimeoutMessage("{0}: {1}", user.Name, m_urlOptions.BanMessage);
m_winterBot.WriteDiagnostic(DiagnosticFacility.Ban, "Banned {0} for {1}.", user.Name, string.Join(", ", urls));
}
else if ((m_urlOptions.ShouldEnforce(user) || m_denyList.Contains(user)) && (!MatchesAll(urls, m_urlWhitelist) || MatchesAny(urls, m_urlBlacklist)))
{
if (m_permit.Contains(user))
m_permit.Remove(user);
else
clearReason = m_urlOptions.Message;
}
}
else if (m_symbolOptions.ShouldEnforce(user) && HasSpecialCharacter(text))
{
clearReason = m_symbolOptions.Message;
}
else if (m_capsOptions.ShouldEnforce(user) && TooManyCaps(user, text))
{
clearReason = m_capsOptions.Message;
}
else if (m_emoteOptions.ShouldEnforce(user) && TooManyEmotes(user, text))
{
clearReason = m_emoteOptions.Message;
}
else if (m_lengthOptions.ShouldEnforce(user) && MessageTooLong(user, text))
{
clearReason = m_lengthOptions.Message;
}
if (clearReason != null)
ClearChat(bot, user, clearReason);
}