Commit d2b6f119 authored by Him188's avatar Him188

Specify lambda param

parent 27a44f08
...@@ -162,15 +162,15 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler ...@@ -162,15 +162,15 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
.sendAndExpect<FriendList.GetTroopListSimplify.Response>(timeoutMillis = 5000, retry = 2) .sendAndExpect<FriendList.GetTroopListSimplify.Response>(timeoutMillis = 5000, retry = 2)
// println("获取到群数量" + troopData.groups.size) // println("获取到群数量" + troopData.groups.size)
val toGet: MutableMap<GroupImpl, ContactList<Member>> = mutableMapOf() val toGet: MutableMap<GroupImpl, ContactList<Member>> = mutableMapOf()
troopListData.groups.forEach { troopListData.groups.forEach { troopNum ->
val contactList = ContactList(LockFreeLinkedList<Member>()) val contactList = ContactList(LockFreeLinkedList<Member>())
val groupInfoResponse = try { val groupInfoResponse = try {
TroopManagement.GetGroupOperationInfo( TroopManagement.GetGroupOperationInfo(
client = bot.client, client = bot.client,
groupCode = it.groupCode groupCode = troopNum.groupCode
).sendAndExpect<TroopManagement.GetGroupOperationInfo.Response>() ).sendAndExpect<TroopManagement.GetGroupOperationInfo.Response>()
} catch (e: Exception) { } catch (e: Exception) {
bot.logger.info("获取" + it.groupCode + "的群设置失败") bot.logger.info("获取" + troopNum.groupCode + "的群设置失败")
TroopManagement.GetGroupOperationInfo.Response( TroopManagement.GetGroupOperationInfo.Response(
allowAnonymousChat = false, allowAnonymousChat = false,
allowMemberInvite = false, allowMemberInvite = false,
...@@ -182,10 +182,10 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler ...@@ -182,10 +182,10 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
GroupImpl( GroupImpl(
bot = bot, bot = bot,
coroutineContext = this.coroutineContext, coroutineContext = this.coroutineContext,
id = it.groupCode, id = troopNum.groupCode,
uin = it.groupUin, uin = troopNum.groupUin,
initName = it.groupName, initName = troopNum.groupName,
initAnnouncement = it.groupMemo, initAnnouncement = troopNum.groupMemo,
initAllowMemberInvite = groupInfoResponse.allowMemberInvite, initAllowMemberInvite = groupInfoResponse.allowMemberInvite,
initConfessTalk = groupInfoResponse.confessTalk, initConfessTalk = groupInfoResponse.confessTalk,
initMuteAll = false,//todo initMuteAll = false,//todo
...@@ -197,11 +197,11 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler ...@@ -197,11 +197,11 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
bot.groups.delegate.addLast(group) bot.groups.delegate.addLast(group)
launch { launch {
try { try {
getTroopMemberList(group, contactList, it.dwGroupOwnerUin) getTroopMemberList(group, contactList, troopNum.dwGroupOwnerUin)
groupInfo[it.groupCode] = contactList.size groupInfo[troopNum.groupCode] = contactList.size
} catch (e: Exception) { } catch (e: Exception) {
groupInfo[it.groupCode] = -1 groupInfo[troopNum.groupCode] = -1
bot.logger.info("群${it.groupCode}的列表拉取失败, 将采用动态加入") bot.logger.info("群${troopNum.groupCode}的列表拉取失败, 将采用动态加入")
bot.logger.error(e) bot.logger.error(e)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment