-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAutoload.php
More file actions
67 lines (63 loc) · 2.93 KB
/
Copy pathAutoload.php
File metadata and controls
67 lines (63 loc) · 2.93 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
// This autoload was developed just as a safe usage of the Discord-PHP library.
// It will automatically include all the libs available.
//////////////////
// Requirements //
//////////////////
require_once(__DIR__ . "/Discord.php");
require_once(__DIR__ . "/Client.php");
///////////////
// Load libs //
///////////////
include_once(__DIR__ . "/Discord/OAuth2.php");
// Guilds
include_once(__DIR__ . "/Discord/Guilds.php");
include_once(__DIR__ . "/Discord/Members.php");
// Channels
include_once(__DIR__ . "/Discord/Channels.php");
include_once(__DIR__ . "/Discord/Messages.php");
// Users
include_once(__DIR__ . "/Discord/Users.php");
//////////// Basic Usage Example
// $configs = New \Discord\Configs(array(
// "token" => "YOUR_BOT_TOKEN",
// "authType" => "Bot", // Optional (Default: Bot)
// "client_id" => "YOUR_CLIENT_ID", // Optional (Default: null)
// "client_secret" => "YOUR_CLIENT_SECRET", // Optional (Default: null)
// "public_key" => "YOUR_PUBLIC_KEY", // Optional (Default: null)
// "stash" => array( // Optional (Default: null)
// "Guild Name" => array(
// "guild_id" => "YOUR_SERVER_ID",
// "channels" => array(
// "Channel Name" => "YOUR_CHANNEL_ID"
// ),
// "roles" => array(
// "Role Name" => "YOUR_ROLE_ID"
// ),
// "members" => array(
// "Member Name" => "YOUR_MEMBER_USER_ID"
// ),
// )
// )
// ));
// $discord = New \Discord\Client($configs);
// $guild = $discord->Guilds("YOUR_GUILD_ID" or "Stash Guild Name");
// $channel = $discord->Channels("YOUR_CHANNEL_ID" or "Stash Guild Channel Name");
// $member = $discord->channels("YOUR_GUILD_ID" or "Stash Guild Name", "YOUR_MEMBER_USER_ID" or "Stash Guild Member Name");
//////////// Standard Usage Example
// $configs = New \Discord\Configs(array( "token" => "YOUR_BOT_TOKEN" ));
// $discord = New \Discord\Client($configs);
// $guild = New \Discord\Client\Guilds($discord, "YOUR_GUILD_ID");
/////////// Custom request example (Get)
// $request = New \Discord\Requests("YOUR_BOT_TOKEN");
// $endpoint = (New \Discord\Endpoints())->get("channels") . "/YOUR_CHANNEL_ID";
// $request->get($endpoint);
/////////// Custom request example (Post)
// $request = New \Discord\Requests("YOUR_BOT_TOKEN");
// $endpoint = (New \Discord\Endpoints())->get("guilds") . "/YOUR_GUILD_ID/channels";
// $request->post($endpoint, $params);
/////////// Manual endpoint request (Get)
// $request->get("https://discord.com/api/{version}/endpoint");
/////////// Manual endpoint request (Post)
// $request->post("https://discord.com/api/{version}/endpoint", $params);
?>