Esempio n. 1
0
        public DiscordBotClient(DiscordProviderConfigurations config)
        {
            client.MessageReceived += async(msg) =>
            {
                await OnMessageReceive.Invoke(new DiscordMessageObject(msg));
            };

            client.MessageUpdated += async(msgCached, newMsg, channel) =>
            {
                await OnMessageEdit.Invoke(new DiscordMessageObject(newMsg), new DiscordChannelObject(channel));
            };
        }
Esempio n. 2
0
        public DiscordBotProvider(DiscordProviderConfigurations config)
        {
            this.config = config;

            client = new DiscordShardedClient(
                new DiscordSocketConfig
            {
                TotalShards = config.ShardCount
            });

            client.MessageReceived += async message =>
            {
                await OnMessageReceive.Invoke(new DiscordMessageObject(message));
            };
        }