public override String run(CommandInfo cmdInfo, Bot bot) { foreach (SteamID steam in bot.SteamFriends.getFriends()) { Console.WriteLine(bot.SteamFriends.GetFriendPersonaName(steam)); if (bot.SteamFriends.GetFriendPersonaName(steam).Equals(cmdInfo.getArg(0), StringComparison.OrdinalIgnoreCase)) { bot.SteamFriends.SendChatMessage(steam, EChatEntryType.ChatMsg, Util.removeArg0(cmdInfo.getArgsStr())); return "Message sent!"; } } return "Could not find user :/"; }
public override String run(CommandInfo cmdInfo, Bot bot) { try { if (cmdInfo.getArg(0).Equals("add", StringComparison.OrdinalIgnoreCase)) { String quote = Util.removeArg0(cmdInfo.getArgsStr()); bot.sql.update("INSERT INTO sayings (message) VALUES ('" + quote + "')"); return "Quote added :D"; } else { List<object[]> myReader = bot.sql.query("SELECT message FROM sayings ORDER BY RAND() LIMIT 1"); if (myReader.Count > 0) { return (string) myReader[0][0]; } else { return "Woops, I canne finda de quotes"; } } } catch (Exception e) { Console.WriteLine(e.Message); } return "I'm in SPAAAAAAAAAAAAACE! ...and there are no quotes in space :<"; }
public override String run(CommandInfo cmdInfo, Bot bot) { return cmdInfo.getArgsStr(); }