├── .gitignore
├── config.example.php.js
├── commands
├── die.php.js
├── ping.php.js
├── echo.php.js
├── yell.php.js
├── whisper.php.js
├── bestwaifu.php.js
├── dank.php.js
├── eval.php.js
└── info.php.js
├── constants.php.js
├── bootstrap.php.js
├── package.json
├── errors.php.js
├── functions
├── typecasting.php.js
├── general_functions.php.js
├── conditional_checks.php.js
├── array_functions.php.js
└── string_functions.php.js
├── index.php.js
├── examples
├── typecasting.php.js
├── strings.php.js
├── arrays.php.js
└── conditionals.php.js
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
3 | config.php.js
4 |
--------------------------------------------------------------------------------
/config.example.php.js:
--------------------------------------------------------------------------------
1 | // 5) return $message.reply('please don\'t mention more than 5 users at a time!');
8 |
9 | var $dank = array_map(function($mention) {
10 | return `<@${$mention[0]}> is dank!`;
11 | }, $mentions);
12 |
13 | return $message['channel'].send(implode('\n', $dank));
14 | }
15 |
16 | exports.arguments = true;
17 |
--------------------------------------------------------------------------------
/errors.php.js:
--------------------------------------------------------------------------------
1 | // 3;
89 | }));
90 |
91 | print_r('\n`array_rand()` examples\n---------------\n');
92 |
93 | print_r('Single key: ');
94 | print_r(array_rand($numbers_words));
95 |
96 | print_r('\nMultiple keys: ');
97 | print_r(array_rand($numbers_words, 5));
98 |
99 | print_r('\n`count()` & `sizeof()` examples\n---------------\n');
100 |
101 | print_r('2D array (non-recursive): ');
102 | print_r(count($2D_array));
103 |
104 | print_r('\n2D array (recursive): ');
105 | print_r(count($2D_array, true));
106 |
107 | print_r('\n`in_array()` examples\n---------------\n');
108 |
109 | print_r('Non-strict: ');
110 | print_r(in_array('1', $numbers));
111 |
112 | print_r('\nStrict: ');
113 | print_r(in_array('1', $numbers, true));
114 |
--------------------------------------------------------------------------------
/functions/general_functions.php.js:
--------------------------------------------------------------------------------
1 | //
2 |
3 |
4 |
5 | # Discord.js Bot (but PHP)
6 |
7 | The most repulsive repo you never wanted to see!
8 |
9 | # FAQ (or something like that)
10 |
11 | ### Wh... Why would you do such a thing?
12 |
13 | I was bored. I needed yet another reason for people to yell at me. This seemed like it'd work well.
14 |
15 | ### Using `var`? Prepending variable names with `$`? Attaching all those functions to `global`?!?!
16 |
17 | ITS. JOKE.
18 |
19 | But there are reasons for each of those.
20 |
21 | * PHP variables are declared and referenced with `$`, so that's a no-brainer.
22 | * PHP variables are function-scoped, just like `var`, so it only makes sense to use `var` over `let` or `const`.
23 | * Attaching functions to `global` is bad, yes, but I couldn't think of any other way to do so. I'd never do such a thing in a real project. You got something better, huh?! (Really, if you do, feel free to create a pull request.)
24 |
25 | ### Some of those functions don't work the exact same as they do in PHP!
26 |
27 | Trust me, I (probably) know. Some are either missing additional parameters, simply can't work the same because of some stupid JavaScript limitation, or some other miscellaneous reason. I tried my best, okay?! 😭
28 |
29 | ### A few of those doc blocks don't look very accurate, or they're a bit inconsistent. Why?
30 |
31 | You can probably blame the PHP docs for some of those. As everyone knows, PHP isn't the most consistent thing in the world. But for inaccurate function/param/return value descriptions, you can probably blame me. I myself probably won't be doing much about it, though.
32 |
33 | ### Did you really spend time and effort into this, all for a joke?
34 |
35 | Yes, yes I did. This is a good measurement of how far I'll go for a joke.
36 |
37 | Did I spend too much time on this? Yes. Could I have spent this time being productive and doing the things I should've been working on instead? Most definitely. Do I regret it at all? Nope!
38 |
39 | Fun fact: I actually occassionally confused myself when looking at this code, because my brain couldn't tell if it was JS or PHP at a glance. With that being said, I think I've achieved the goal of this project.
40 |
41 | ### How do I contribute to this ridiculous project?
42 |
43 | Are you drunk? Not even ***I*** want to contribute.
44 |
45 | ... But if you really want to, feel free to create a pull request - even if it's just for shits 'n giggles. As long as it looks like real PHP, anything goes.
46 |
47 | # Examples
48 |
49 | For the sake of taking this joke even further, I went the extra mile and made an examples folder. You can check them out by running `npm run