Alter networking to include authorization bot header, and add initial sticker calls
This commit is contained in:
parent
eae1f391de
commit
6079fa9a01
6 changed files with 95 additions and 6 deletions
|
@ -8,7 +8,7 @@ import '../structures/user.dart';
|
|||
class UserPackets {
|
||||
/// Requests the current user from Discord's servers
|
||||
static Future<User> getCurrentUser() async {
|
||||
Dio dio = Dio();
|
||||
Dio dio = Dio(DiscordSessionSettings.getOptions);
|
||||
var reply = await dio.get(
|
||||
"${DiscordEndpoints.BaseURL}${DiscordEndpoints.Users}${DiscordEndpoints.ME}");
|
||||
|
||||
|
@ -19,7 +19,7 @@ class UserPackets {
|
|||
///
|
||||
/// [id] is expected to be a valid Discord User ID
|
||||
static Future<User> getUser(int id) async {
|
||||
Dio dio = Dio();
|
||||
Dio dio = Dio(DiscordSessionSettings.getOptions);
|
||||
var reply = await dio
|
||||
.get("${DiscordEndpoints.BaseURL}${DiscordEndpoints.Users}/${id}");
|
||||
|
||||
|
@ -30,7 +30,7 @@ class UserPackets {
|
|||
///
|
||||
/// Fires a User Update gateway event
|
||||
static Future<User> updateCurrentUser(ModifyCurrentUserPacket mcup) async {
|
||||
Dio dio = Dio();
|
||||
Dio dio = Dio(DiscordSessionSettings.getOptions);
|
||||
var reply = await dio.patch(
|
||||
"${DiscordEndpoints.BaseURL}${DiscordEndpoints.Users}${DiscordEndpoints.ME}",
|
||||
data: mcup.encode());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue