-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample.php
More file actions
44 lines (34 loc) · 929 Bytes
/
example.php
File metadata and controls
44 lines (34 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* Example script
*
* Open console or terminal and run:
*
* ```bash
* php ./example.php
* ```
*
* @author Alexandr Gorlov <a.gorlov@gmail.com>
*/
require_once 'Msg.php';
require_once 'DiscordMsg.php';
echo "To see dumb messages..\n";
echo "..join the discordmsg chanel https://discord.gg/jB5FsPf and enjoy!\n";
echo "Feel free to test!\n";
// First message
$msg = new \AG\DiscordMsg('Hello, Friends');
$msg->send();
// Second message
(new \AG\DiscordMsg(
'I started the example.php, something happened?',
null,
$_ENV["USER"] ?? 'Mr. Pitkin'
))->send();
// Third message
(new \AG\DiscordMsg(
"Maybe the missile is launched? :grimacing:", // message
'https://discordapp.com/api/webhooks/475239272610398218/' . // chanel webhook link
'tfpeg5EFI_94oEHfltZwcB5UAurfcswkBw5mKouZCq-akhvxe5BNOtN16AqSHvmSwpum',
get_current_user(), // bot name
'' // avatar url
))->send();