本文整理汇总了C#中Bot.Promote方法的典型用法代码示例。如果您正苦于以下问题:C# Bot.Promote方法的具体用法?C# Bot.Promote怎么用?C# Bot.Promote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bot
的用法示例。
在下文中一共展示了Bot.Promote方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: cmd_promote
public static void cmd_promote(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
{
String helpmsg = String.Format("<b>» Usage:</b> {0}promote <i>[#channel]</i> username <i>privclass</i>", bot.Config.Trigger);
if (args.Length < 2)
{
bot.Say(ns, helpmsg);
}
else
{
String chan, who, pc;
if (!args[1].StartsWith("#"))
{
chan = ns;
who = args[1];
pc = (args.Length >= 3 ? args[2] : null);
}
else if (args.Length >= 3)
{
chan = args[1];
who = args[2];
pc = (args.Length >= 4 ? args[3] : null);
}
else
{
bot.Say(ns, helpmsg);
return;
}
lock (CommandChannels["send"])
{
CommandChannels["send"].Add(ns);
}
bot.Promote(chan, who, pc);
}
}
示例2: ParseBDS
//.........这里部分代码省略.........
{
trig = String.Empty;
for (int b = 6; b < data.Length; b++)
{
if (b >= data.Length - 1)
trig += data[b];
else
trig += data[b] + ",";
}
}
if (!Double.TryParse(versions[1], out bdsver))
bdsver = 0.2;
Types.BotInfo bot_info = new Types.BotInfo(from, data[1], data[2], botver, trig, bdsver, Bot.EpochTimestamp);
String hashkey = Tools.md5((trig + data[0] + from).ToLower().Replace(" ", "")).ToLower();
ClearKickTimers(from);
if (hashkey != hash)
{
// Invalid hash supplied
// For now, we ignore this. Though I'd like to see policebots send and error like:
// BDS:BOTCHECK:ERROR:INVALID_RESPONSE_HASH
// Police bot stuff.
if ((ns == "chat:DSGateway" || ns == "chat:DataShare") && IsPoliceBot(username, ns))
{
if (ns == "chat:DSGateway")
bot.NPSay(ns, "BDS:BOTCHECK:DENIED:" + from + ",Invalid BDS:BOTCHECK");
bot.Kick(ns, from, "No response to or invalid BDS:BOTCHECK. If you are not a bot, please do not join this room. Thanks.");
bot.Promote("chat:DataShare", from, "BrokenBots");
if (!Kicks.ContainsKey(from))
Kicks.Add(from, new KickInfo());
Kicks[from].Kick();
if (Kicks[from].Count >= 3)
{
bot.Ban(ns, from);
var t = new Timer(5000);
t.Elapsed += delegate { bot.UnBan(ns, from); };
t.Start();
}
}
if (Program.Debug)
ConIO.Warning("BDS", "Invalid hash for bot: " + from);
}
else
{
// Police bot stuff.
if ((ns == "chat:DSGateway" || ns == "chat:DataShare") && IsPoliceBot(username, ns))
{
if (ns == "chat:DSGateway")
{
if (!GateChecks.Contains(from))
GateChecks.Add(from);
bot.NPSay(ns, "BDS:BOTCHECK:OK:" + from);
}
bot.Promote("chat:DataShare", from, "Bots");
}