class Worker::DiscordClient

Overview

Discord facade

Defined in:

worker/discord_client.cr
worker/discord_client/async_voice_client.cr
worker/discord_client/not_found_error.cr
worker/discord_client/voice_client.cr

Constant Summary

INTENTS = ((Discord::Gateway::Intents::Guilds | Discord::Gateway::Intents::GuildVoiceStates) | Discord::Gateway::Intents::GuildMessages) | Discord::Gateway::Intents::DirectMessages
Log = Worker::Log.for("discord_client")
STATUS_UPDATE_INTERVAL = 15.minutes
VOICE_RECONNECTION_AWAIT = 1.second

Constructors

Instance Method Summary

Constructor Detail

def self.new(worker : Worker) #

[View source]

Instance Method Detail

def delete_message(channel_id : UInt64, message_id : UInt64) : Nil #

[View source]
def log(message : String) : Nil #

[View source]
def role_id_by_name(role_name : String) : UInt64 #

[View source]
def role_name(role_id : UInt64) : String #

[View source]
def run : Nil #

[View source]
def send_dm(user_id : UInt64, text : String) : UInt64 | Nil #

[View source]
def send_embed(channel_id : UInt64, title : String, description : String, footer_text : String | Nil = nil, color : UInt32 | Nil = nil, fields : Array(EmbedFieldData) = Array(EmbedFieldData).new) : UInt64 | Nil #

[View source]
def server_administrator_roles_ids(server_id : UInt64) : Array(UInt64) #

[View source]
def server_name(server_id : UInt64) : String #

[View source]
def server_owner_id(server_id : UInt64) : UInt64 #

[View source]
def servers_count : UInt64 #

[View source]
def stop : Nil #

[View source]
def user_voice_channel_id(server_id : UInt64, user_id : UInt64) : UInt64 | Nil #

[View source]
def voice_channel_users(server_id : UInt64, voice_channel_id : UInt64) : Array(UInt64) #

[View source]
def voice_client(server_id : UInt64) : VoiceClient | Nil #

[View source]
def voice_state_update(server_id : UInt64, channel_id : UInt64 | Nil) : Nil #

[View source]