public DiscordBotManager(DiscordApiClient apiClient, DiscordGatewayClient gatewayClient, DatabaseContext databaseContext, CommandHandler commandHandler, ILogger logger, IOptions <BotSettingsConfiguration> options) { ApiClient = apiClient; GatewayClient = gatewayClient; DbContext = databaseContext; BotUser = new DiscordBotUser(); CommandHandler = commandHandler; Logger = logger; OwnerID = options.Value.AdminID; GatewayClient.AddMessageCallback(HandleGatewayEvent); }
public DiscordVoiceClient(string userId, DiscordGatewayClient gateway) { this.gateway = gateway; this.userId = userId; //Voice initialization Messenger.AddListener <VoiceServerUpdate>(DiscordEvent.Voice.ServerUpdate, OnServerUpdate); Messenger.AddListener <VoiceStateUpdateResponse>(DiscordEvent.Voice.StatusUpdate, OnStatusUpdate); Messenger.AddListener <HelloEventData>(DiscordEvent.Voice.Hello, OnHello); Messenger.AddListener <VoiceReadyResponse>(DiscordEvent.Voice.Ready, OnReady); Messenger.AddListener <SessionDesciptionResponse>(DiscordEvent.Voice.SessionDesciption, OnSessionDescription); //Messenger.AddListener<SpeakingResponse>(DiscordEvent.Voice.Speaking, OnSpeaking); Messenger.AddListener <byte[]>(DiscordEvent.Voice.Packet, OnPacket); }
public void Connect() { gateway = new DiscordGatewayClient(GatewayUrl); }
/// <summary> /// Initializes a new instance of the <see cref="DiscordService"/> class. /// </summary> /// <param name="gatewayClient">The <see cref="DiscordGatewayClient"/>.</param> /// <param name="logger">The <see cref="ILogger"/>.</param> public DiscordService(DiscordGatewayClient gatewayClient, ILogger <DiscordService> logger) { _gatewayClient = gatewayClient; _logger = logger; }
public CrabotClient(DiscordGatewayClient discordGatewayClient) { _discordGatewayClient = discordGatewayClient; }
public ModixBot(DiscordGatewayClient client) => _client = client;