Skip to content

Commit

Permalink
修复权限管理bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev-Umb committed Jun 28, 2021
1 parent 45dfb95 commit 2e2e60a
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 16 deletions.
Binary file modified .gradle/6.3/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/6.3/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/6.3/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/6.3/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/6.3/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/6.3/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file modified .gradle/6.3/javaCompile/jarAnalysis.bin
Binary file not shown.
Binary file modified .gradle/6.3/javaCompile/javaCompile.lock
Binary file not shown.
Binary file modified .gradle/6.3/javaCompile/taskHistory.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
12 changes: 6 additions & 6 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dbUrl: "" # 你的数据库端口链接
dbUrl: "jdbc:mysql://118.178.255.237:3306/umb?serverTimezone=UTC&characterEncoding=UTF-8" # 你的数据库端口链接

dbUser: "" # 数据库用户名
dbPwd: "" # 数据库密码
botQQ: "" # 机器人的QQ
botPwd: "" # 机器人的密码
superUser: "" # 超级管理员QQ(可写可不写)
dbUser: "umb" # 数据库用户名
dbPwd: "0blp59XJnU8VAD4Y" # 数据库密码
botQQ: "3394886607" # 机器人的QQ
botPwd: "meimima123" # 机器人的密码
superUser: "1149558764" # 超级管理员QQ(可写可不写)
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ import kotlin.coroutines.CoroutineContext
internal val appJob = Job()

object CommandGroupList {
lateinit var welcomeGroupList:LinkedList<Long>
lateinit var managerGroupList:LinkedList<Long>
lateinit var forwardMessageGroup:HashMap<Long,Boolean>
lateinit var welcomeGroupList:ArrayList<Long>
lateinit var managerGroupList:ArrayList<Long>
fun init(){
welcomeGroupList = LinkedList()
managerGroupList = LinkedList()
forwardMessageGroup = HashMap()
welcomeGroupList = ArrayList()
managerGroupList = ArrayList()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class BotGroupCommandListener:BaseListeners() {
return@route
}
case("manage", "仅限管理员进行操作",false) {
if (event.group.id !in CommandGroupList.welcomeGroupList) {
if (event.group.id !in CommandGroupList.managerGroupList) {
CommandGroupList.managerGroupList.add(event.group.id)
}
subject.sendMessage("开启词条管理!")
return@route
}
case("dismanage", "关闭仅限管理员进行操作",false) {
if (event.group.id in CommandGroupList.welcomeGroupList) {
if (event.group.id in CommandGroupList.managerGroupList) {
CommandGroupList.managerGroupList.remove(event.group.id)
}
subject.sendMessage("关闭词条管理!")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class BotGroupMsgListener : BaseListeners() {
route(prefix = "", delimiter = " ") {
if (SessionManager.hasSession(sender.id)) {
if (SessionManager.performSession(event)) {

subject.sendMessage("录入成功!任务正在处理,请稍等")
return@route
}
Expand Down Expand Up @@ -93,7 +92,7 @@ class BotGroupMsgListener : BaseListeners() {
subject.sendMessage("问题与模块名冲突!,模块名:${helpMap[question]}")
return@route
}
if (question!!.isEmpty())
if (question.isEmpty())
return@route
val furry = Regex("""#\d""")
if (furry.matches(question)) {
Expand Down

0 comments on commit 2e2e60a

Please sign in to comment.