@@ -11,7 +11,7 @@ class Ourted extends Bot
11
11
12
12
public function __construct ()
13
13
{
14
- $ dotenv = Dotenv::createImmutable (__DIR__ . ' /../ ' );
14
+ $ dotenv = Dotenv::createImmutable (__DIR__ );
15
15
$ dotenv ->load ();
16
16
$ this ->token = $ _ENV ['BOT_TOKEN ' ];
17
17
parent ::__construct ($ this ->token , "! " );
@@ -42,33 +42,22 @@ public function setBot()
42
42
// Change Bot Username
43
43
$ settings ->change_bot_username ("test_bot " );
44
44
45
- /* Embed Start */
46
- $ embed_array = array ();
47
- $ embed_string = "" ;
48
- foreach ($ this ->guild ->get_guilds_properties () as $ key => $ server ) {
49
- $ embed_array [] = array ("name " => "Server of {$ key }. " , "value " => $ server ->name );
50
- $ embed_string .= " Server of {$ key }: {$ server ->name } " ;
51
- }
52
45
53
46
54
- // Without Embed
55
- $ this ->channel ->sendMessage ("Family: " . $ embed_string , $ channel );
47
+ /* Embed Start */
56
48
57
49
58
- // With Single Array
59
- $ embed = $ this -> createEmbed ( " Family " , $ channel , " Family " );
60
- $ embed ->add_field ($ embed_array );
50
+ $ embed = $ this -> createEmbed ( " TITLE " , $ channel , " DESCIPTION " );
51
+ $ embed-> add_field ( " Field 1 " , " Field 1 Value " );
52
+ $ embed ->add_field (" Field 2 " , " Field 2 Value " );
61
53
$ embed ->send_embed ();
62
54
55
+ /* Embed End */
63
56
64
- // With Multiple Array
65
- $ embed = $ this ->createEmbed ("Family " , $ channel , "Family " );
66
- $ embed ->add_field (array ("name " => "Field 1 " , "value " => "Field 1 Value " ), array ("name " => "Field 2 " , "value " => "Field 2 Value " ));
67
- $ embed ->send_embed ();
68
57
69
- /* Embed End */
70
58
71
59
/* Bulk Delete Start */
60
+
72
61
$ ids = "" ;
73
62
// Count Messages
74
63
foreach ($ this ->channel ->getMessages ($ channel ) as $ key => $ item ) {
@@ -78,9 +67,11 @@ public function setBot()
78
67
count (json_decode ($ this ->channel ->getMessages ($ channel ))) -1 == $ key ?
79
68
$ ids .= "\"$ item ->id \"" : $ ids .= "\"$ item ->id \", " ;
80
69
}
81
- // Delete Messages
70
+ // Delete Bulk Message
82
71
$ this ->channel ->deleteBulkMessage ("[ {$ ids }] " , $ channel );
83
72
73
+ /* Bulk Delete End */
74
+
84
75
// Get Role
85
76
echo $ this ->guild ->getRole ($ this ->guild ->getGuild (742361616728719373 ), 742404691979272203 )->name ;
86
77
// Result: Test
0 commit comments