本文整理汇总了TypeScript中@csegames/camelot-unchained/lib/webAPI/definitions.GroupsAPI.KickV1方法的典型用法代码示例。如果您正苦于以下问题:TypeScript GroupsAPI.KickV1方法的具体用法?TypeScript GroupsAPI.KickV1怎么用?TypeScript GroupsAPI.KickV1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@csegames/camelot-unchained/lib/webAPI/definitions.GroupsAPI
的用法示例。
在下文中一共展示了GroupsAPI.KickV1方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: kickFromBattlegroup
async function kickFromBattlegroup(targetEntityID: string, targetCharacterID: string,
targetName: string, battlegroupID: string) {
try {
const result = await GroupsAPI.KickV1(
defaultConfig,
game.shardID,
game.selfPlayerState.characterID,
battlegroupID,
targetEntityID,
targetCharacterID,
targetName,
);
if (result.ok) {
sendSystemMessage(`Kicked!`);
return;
}
sendSystemMessage(`Failed to kick.`);
console.error('Failed to kick.\n' + JSON.stringify(result.data));
} catch (error) {
// failed!!
console.error('Failed to kick.\n' + error);
}
}
示例2: kickFromWarband
async function kickFromWarband(targetEntityID: string, targetCharacterID: string,
targetName: string, warbandID: string) {
try {
const result = await GroupsAPI.KickV1(
defaultConfig,
client.shardID,
client.characterID,
warbandID,
targetEntityID,
targetCharacterID,
targetName,
);
if (result.ok) {
sendSystemMessage(`Kicked!`);
return;
}
sendSystemMessage(`Failed to kick.`);
console.error('Failed to kick.\n' + JSON.stringify(result.data));
} catch (error) {
// failed!!
console.error('Failed to kick.\n' + error);
}
}