コード例 #1
0
        public static async void HandleWiped()
        {
            if (_isPulled)
            {
                Logger.Debug("Clipping and sending message.");
                _isPulled = false;
                _wipeTime = DateTime.Now.TimeOfDay;
                var clips = await TwitchApiHandler.MakeClip(Settings.UserIDs);

                var message = "";

                foreach (var userIdPair in Settings.UserIDs)
                {
                    try {
                        Logger.Debug($"Adding clip from {userIdPair.Key} to message.");
                        message += $"{userIdPair.Key}'s POV: {clips[userIdPair.Value]}\n";
                    } catch (Exception ex) {
                        Logger.Error($"Unable to add clip from #{userIdPair.Key}.", ex);
                    }
                }

                var totalPullTime = DateTime.Now.TimeOfDay - _pullTime;

                var isGreen = totalPullTime.TotalSeconds > _preset.settings.GreenThreshold;
                _pullTimes.Add((int)totalPullTime.TotalSeconds);

                await Discord.SendMessage(message + "\n", $"Wipe #{++_wipes} - {totalPullTime:mm\\:ss}min", isGreen);
            }
        }
コード例 #2
0
        public static async Task HandleManualClip()
        {
            Logger.Debug("Creating clip manually.");

            var clips = await TwitchApiHandler.MakeClip(Settings.UserIDs);

            var message = "";

            foreach (var userIdPair in Settings.UserIDs)
            {
                try {
                    Logger.Debug($"Adding clip from {userIdPair.Key} to message.");
                    message += $"{userIdPair.Key}'s POV: {clips[userIdPair.Value]}\n";
                } catch (Exception ex) {
                    Logger.Error($"Unable to add clip from #{userIdPair.Key}.", ex);
                }
            }

            await Discord.SendMessage(message + "\n", "Manual clip", null);
        }