Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.
LennyPhoenix edited this page Jun 3, 2021 · 2 revisions

Contents

Discord

discorsdk.Discord

Description

This is the core class in the SDK, you must instantiate this to interact with the other components of this module.

Initialiser

__init__(client_id: int, flags: discordsdk.CreateFlags)

Arguments

  • client_id: int - The ID of your application.

  • flags: discordsdk.CreateFlags - The flags to create the instance with:

    • CreateFlags.default - Makes sure that Discord is currently running, and if not it will close the app, start Discord then reopen the application. Note that this behaviour may not work as intended depending on how you run your program.

    • CreateFlags.no_require_discord - Will return Result.internal_error.

Methods

Set Log Hook

set_log_hook(min_level: LogLevel, hook: Callable[[LogLevel, str], None])

Registers a logging callback function with the minimum level of message to receive.

Arguments

  • min_level: LogLevel - The minimum level of message to receive.
  • hook: Callable[[LogLevel, str], None] - The function to log to.

Run Callbacks

run_callbacks()

Runs any callbacks for the SDK, will raise a DiscordException if the callback result is not ok.

Get Activity Manager

get_activity_manager() -> ActivityManager

Fetches an instance of the manager for interfacing with activies in the SDK.

Returns

ActivityManager - The activity manager instance.

Get Relationship Manager

get_relationship_manager() -> RelationshipManager

Fetches an instance of the manager for interfacing with relationships in the SDK.

Returns

RelationshipManager - The relationship manager instance.

Get Image Manager

get_image_manager() -> ImageManager

Fetches an instance of the manager for interfacing with images in the SDK.

Returns

ImageManager - The image manager instance.

Get User Manager

get_user_manager() -> UserManager

Fetches an instance of the manager for interfacing with users in the SDK.

Returns

UserManager - The user manager instance.

Get Lobby Manager

get_lobby_manager() -> LobbyManager

Fetches an instance of the manager for interfacing with lobbies in the SDK.

Returns

LobbyManager - The lobby manager instance.

Get Network Manager

get_network_manager() -> NetworkManager

Fetches an instance of the manager for interfacing with networking in the SDK.

Returns

NetworkManager - The network manager instance.

Get Overlay Manager

get_overlay_manager() -> OverlayManager

Fetches an instance of the manager for interfacing with overlays in the SDK.

Returns

OverlayManager - The overlay manager instance.

Get Application Manager

get_application_manager() -> ApplicationManager

Fetches an instance of the manager for interfacing with applications in the SDK.

Returns

ApplicationManager - The application manager instance.

Get Storage Manager

get_storage_manager() -> StorageManager

Fetches an instance of the manager for interfacing with storage in the SDK.

Returns

StorageManager - The storage manager instance.

Get Store Manager

get_store_manager() -> StoreManager

Fetches an instance of the manager for interfacing with SKUs and entitlements in the SDK.

Returns

StoreManager - The store manager instance.

Get Voice Manager

get_voice_manager() -> VoiceManager

Fetches an instance of the manager for interfacing with voice chat in the SDK.

Returns

VoiceManager - The voice manager instance.

Get Achievement Manager

get_achievement_manager() -> AchievementManager

Fetches an instance of the manager for interfacing with achievements in the SDK.

Returns

AchievementManager - The achievement manager instance.