public SerifBlock(Text text, string str, float second, AudioSource audioSource, AudioClip sound, SerifType type) { this.panel = text; this.str = str; this.interval = second * 1000; timer = new System.Diagnostics.Stopwatch(); this.type = type; //サウンド関連 this.sound = sound; this.audioSource = audioSource; }
public string GetUseSerif(string name, SerifType type, bool record = false) { //if (cacheSerif != null) return cacheSerif; var enableSerif = GetSerif(name, type).ToList(); if (record) { enableSerif = enableSerif.Where(IsEnableTime).ToList(); } var serif = enableSerif[_rand.Next(enableSerif.Count)]; if (record) { serifsController.SetUsedTime(serif.Id); } return(serif.Text); }
//フォロワーさんを励ます機能 public async Task SendMessageToFollowerAsync <TWords>(ICharacter character, TWords word, SerifType type, IUsingDataTable usingDataTable) where TWords : IWords { var timeline = await twitterHelper.GetTimeLineAsync(); var tsuraiTweets = timeline.Where(e => e.RetweetedStatus == null).Where(e => !e.IsFavorited ?? true).Where(e => word.IsContained(e.Text)).Select(e => new { UserId = e.User.Id, e.Id, e.User.Name, e.Text }); foreach (var tsuraiTweet in tsuraiTweets) { if (tsuraiTweet.UserId == await twitterHelper.GetMyId()) { continue; } if (tsuraiTweet.Text.Contains("@")) { continue; } if (tsuraiTweet.Text.Contains("@")) { continue; } string mes = usingDataTable.GetUseSerif(character.Name, type); var txt = mes.Replace("{ScreenName}", tsuraiTweet.Name); await twitterHelper.ReplyAsync(tsuraiTweet.Id, txt); await Task.Delay(100); await twitterHelper.FavoritesAsync(tsuraiTweet.Id); } }
private IEnumerable <SerifData> GetSerif(string name, SerifType type) { return(serifsController.GetSerifs().Where(e => e.Name == name).Where(e => e.Type == type)); }
//フォロワーさんを励ましたりする public async Task SendMessageToFollowerAsync <TWords>(ICharacter character, TWords words, SerifType type, IUsingDataTable usingDataTable) where TWords : IWords { foreach (var mastodonHelper in mastodonHelpers) { var timeline = await mastodonHelper.GetTimeLineAsync(); var tsuraiTweets = timeline.Where(e => !e.Reblogged ?? true).Where(e => e.Reblog == null).Where(e => !e.Favourited ?? true).Where(e => words.IsContained(e.Content)).Where(e => e.Account.Id != mastodonHelper.CurrentUser.Id).Where(e => e.Url.Contains(mastodonHelper.Instance)).Select(e => new { UserId = e.Account.Id, e.Id, e.Account.DisplayName, e.Account.AccountName, e.Content }); foreach (var tsuraiTweet in tsuraiTweets) { if (tsuraiTweet.Content.Contains("@")) { continue; } if (tsuraiTweet.Content.Contains("@")) { continue; } string mes = usingDataTable.GetUseSerif(character.Name, SerifType.Ganbare); string name = GetDisplayName(tsuraiTweet.DisplayName, tsuraiTweet.AccountName); var txt = "@" + tsuraiTweet.AccountName + " " + mes.Replace("{ScreenName}", name); await mastodonHelper.ReplyAsync(tsuraiTweet.Id, Mastonet.Visibility.Unlisted, txt); await Task.Delay(100); await mastodonHelper.FavouriteAsync(tsuraiTweet.Id); } } }
/* * public TimerBlock FadeToBlack(float interval) * { * return new FadeOn(Block.Instance.fade, interval); * } * * public TimerBlock FadeToClear(float interval) * { * return new FadeOff(Block.Instance.fade, interval); * } */ public ProcessBlock SerifDetail(string str, float second, AudioClip sound, SerifType type) { return(new SerifBlock(Block.Instance.chatText, str, second, Block.Instance.shotLine, sound, type)); }
public async Task SendMessageToFollowerAsync <TWords>(TWords words, SerifType type) where TWords : IWords { await _platform.SendMessageToFollowerAsync(_character, words, type, _usingDataTable); }