Example #1
0
        private static int LowLevelKeyboardProc(int nCode, int wParam, IntPtr lParam)
        {
            if (nCode < 0)
            {
                CallNextHookEx(kbh_Handle, nCode, wParam, lParam);
                return(0);
            }


            if (wParam == WM_KEYDOWN)
            {
                IntPtr          kbdll       = lParam;
                KBDLLHOOKSTRUCT kbdllstruct = (KBDLLHOOKSTRUCT)Marshal.PtrToStructure(kbdll, typeof(KBDLLHOOKSTRUCT));

                if (kbdllstruct.vkCode == 0x2c)
                {
                    DiscordBot.sendScreenshot();
                    return(1);
                }
            }

            return(CallNextHookEx(kbh_Handle, nCode, wParam, lParam));
        }
Example #2
0
 void startBot()
 {
     DiscordBot.initialize("NTUzNzc2NjY3NTU4OTM2NTc2.D2THiw.kHiu96iirilxaVf8lQk7AUkMXNc").ConfigureAwait(false).GetAwaiter().GetResult();
 }