一旦有人将机器人添加到好友列表中,机器人就会接受请求并向新的“朋友”发送消息,我希望它也向我的 steamID 发送消息,但由于某种原因它无法正常工作
它确实接受并向新朋友发送消息,但不向我发送消息,
static void OnFriendsList(SteamFriends.FriendsListCallback callback)
{
Thread.Sleep(2500);
foreach(var friend in callback.FriendList)
{
if (friend.Relationship == EFriendRelationship.RequestRecipient)
{
steamFriends.AddFriend(friend.SteamID);
Thread.Sleep(500);
steamFriends.SendChatMessage(friend.SteamID, EChatEntryType.ChatMsg, "Hello I am a bot");
steamFriends.SendChatMessage(new SteamID { Value = "76561198145164176" }, EChatEntryType.ChatMsg, "A friend had added me!"); //This ain't working
}
}
}
在 Value 处也出现语法错误,
Severity Code Description Project File Line
Error CS0117 'SteamID' does not contain a definition for 'Value' Tutorialbot C:\Users\Stagiair\Documents\Visual Studio 2015\Projects\Tutorialbot\Tutorialbot\Program.cs 180
文档:http ://www.nudoq.org/#!/Packages/SteamKit2/SteamKit2/SteamFriends/M/SendChatMessage