Discord Pro Mode

Discord mod mods

  1. // ==UserScript==
  2. // @name Discord Pro Mode
  3. // @namespace trysten
  4. // @version 0.2.0
  5. // @description Discord mod mods
  6. // @author trysten
  7. // @match https://*.discord.com/app
  8. // @match https://*.discord.com/channels/*
  9. // @icon https://discord.com/assets/847541504914fd33810e70a0ea73177e.ico
  10. // @license GPLv3
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. function respond(e) {
  17. // function showChar(e) {
  18. // console.debug(`Key Pressed: ${e.key}\nCTRL key pressed: ${e.ctrlKey}\n`);
  19. // }
  20. // console.debug(showChar(e));
  21.  
  22. if(e.altKey) {
  23. switch (e.key) {
  24. // disappear left menu and use ctrl + k to be mega
  25. case '[':
  26. var sidebar = document.getElementById('channels').parentElement.parentElement;
  27. var newstate = sidebar.style.display == "none" ? "" : "none";
  28. sidebar.style.display = newstate;
  29. e.preventDefault();
  30. break;
  31. // phat search
  32. case ']':
  33. var sidebar = document.getElementById('search-results').parentElement.parentElement;
  34. console.log(sidebar.style.width);
  35. if (sidebar.style.width == "" || sidebar.style.width == "418px") {
  36. var newstate = "836px";
  37. }
  38. else if (sidebar.style.width == "836px") {
  39. var newstate = "100%";
  40. }
  41. else {
  42. var newstate = "418px"
  43. }
  44. sidebar.style.width = newstate;
  45. e.preventDefault();
  46. break;
  47. default:
  48. Function.prototype(); //noop lol
  49. break;
  50. }
  51. }
  52. }
  53. document.addEventListener('keydown', respond, false);
  54. })();