Ejemplo n.º 1
0
 private void PrivateMsgSend_Click(object sender, RoutedEventArgs e)
 {
     DebugerApp.LogWhenThrow(() => DebugerApp.PrivateMsgEvent(
                                 int.Parse(PrivateMsgSubType.TextBoxText),
                                 int.Parse(PrivateMsgMsgId.TextBoxText),
                                 long.Parse(PrivateMsgFromQq.TextBoxText),
                                 PrivateMsgMsg.TextBoxText,
                                 int.Parse(PrivateMsgFont.TextBoxText)));
 }
Ejemplo n.º 2
0
 private void GroupMsgSend_Click(object sender, RoutedEventArgs e)
 {
     DebugerApp.LogWhenThrow(() => DebugerApp.GroupMsgEvent(
                                 int.Parse(GroupMsgSubType.TextBoxText),
                                 int.Parse(GroupMsgMsgId.TextBoxText),
                                 long.Parse(GroupMsgFromGroup.TextBoxText),
                                 long.Parse(GroupMsgFromQq.TextBoxText),
                                 GroupMsgFromAnonymous.TextBoxText,
                                 GroupMsgMsg.TextBoxText,
                                 int.Parse(GroupMsgFont.TextBoxText)));
 }
Ejemplo n.º 3
0
        public static bool CheckAuthCodePermission(int authCode, int auth)
        {
            var plugin = GetPluginByAuthCode(authCode);

            if (plugin == null)
            {
                DebugerApp.AddLog(CQLogLevel.Warning, "非法操作", $"试图通过未知AppId({authCode})调用函数");
                return(false);
            }

            if (auth == -1)
            {
                return(true);
            }

            if (!plugin.info.auth.Contains(auth))
            {
                DebugerApp.AddLog(CQLogLevel.Warning, "非法操作", $"应用 {authCode} 不具有权限: {auth}");
                return(false);
            }

            return(true);
        }