This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shamrock
: support /delete_guild_role
- Loading branch information
1 parent
7952453
commit c436898
Showing
5 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProResultCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.tencent.qqnt.kernel.nativeinterface; | ||
|
||
public interface IGProResultCallback { | ||
void onResult(int code, String msg, GProSecurityResult result); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/DeleteGuildRole.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package moe.fuqiuluo.shamrock.remote.action.handlers | ||
|
||
import kotlinx.serialization.json.JsonElement | ||
import moe.fuqiuluo.qqinterface.servlet.GProSvc | ||
import moe.fuqiuluo.shamrock.remote.action.ActionSession | ||
import moe.fuqiuluo.shamrock.remote.action.IActionHandler | ||
import moe.fuqiuluo.shamrock.tools.EmptyJsonString | ||
import moe.fuqiuluo.symbols.OneBotHandler | ||
|
||
@OneBotHandler("delete_guild_role") | ||
internal object DeleteGuildRole: IActionHandler() { | ||
override suspend fun internalHandle(session: ActionSession): String { | ||
val guildId = session.getString("guild_id").toULong() | ||
val roleId = session.getString("role_id").toULong() | ||
return invoke(guildId, roleId, session.echo) | ||
} | ||
|
||
operator fun invoke(guildId: ULong, roleId: ULong, echo: JsonElement = EmptyJsonString): String { | ||
GProSvc.deleteGuildRole(guildId, roleId) | ||
return ok("success", echo = echo) | ||
} | ||
|
||
override val requiredParams: Array<String> = arrayOf("guild_id", "role_id") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters