Skip to content

Commit

Permalink
Silent: 黙らせる機能をオミット
Browse files Browse the repository at this point in the history
  • Loading branch information
2RiniaR committed Nov 27, 2024
1 parent f4091a0 commit 5e21260
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 50 deletions.
1 change: 0 additions & 1 deletion Common/Master/SettingMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ private int GetInt(string key)

public int ReplyMaxDuration => GetInt(nameof(ReplyMaxDuration));
public int TypingMaxDuration => GetInt(nameof(TypingMaxDuration));
public int SilentDuration => GetInt(nameof(SilentDuration));
public int DailyResetTime => GetInt(nameof(DailyResetTime));
public int MonthlyResetDay => GetInt(nameof(MonthlyResetDay));
public int BirthdayMonth => GetInt(nameof(BirthdayMonth));
Expand Down
1 change: 0 additions & 1 deletion Common/Master/TriggerPhraseMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public class TriggerPhraseMaster : MasterTable<string, TriggerPhrase>;
public enum TriggerType
{
Unknown,
Silent,
GachaExecute,
GachaGet,
Marugame,
Expand Down
23 changes: 0 additions & 23 deletions Common/Models/SilentManager.cs

This file was deleted.

6 changes: 4 additions & 2 deletions Events/Gacha/GachaRareReplyPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ public class GachaRareReplyPresenter : DiscordMessagePresenterBase
{
protected override async Task MainAsync()
{
if (SilentManager.IsSilent(Message.Author.Id) ||
Message.Channel.Id != EnvironmentManager.DiscordMainChannelId) return;
if (Message.Channel.Id != EnvironmentManager.DiscordMainChannelId)
{
return;
}

await using var app = AppService.CreateSession();
var user = await app.FindOrCreateUserAsync(Message.Author.Id);
Expand Down
17 changes: 0 additions & 17 deletions Events/Gacha/GachaRareReplySupressPresenter.cs

This file was deleted.

8 changes: 2 additions & 6 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private static async Task BuildAsync(string[] args)

SchedulerManager.RegisterDaily<DailyResetPresenter>(TimeManager.DailyResetTime);
SchedulerManager.RegisterYearly<DailyResetBirthPresenter>(TimeManager.Birthday + TimeManager.DailyResetTime +
TimeSpan.FromSeconds(1));
TimeSpan.FromSeconds(1));
SchedulerManager.RegisterMonthly<MonthlyResetPresenter>(TimeManager.MonthlyResetDay,
TimeManager.DailyResetTime);

Expand Down Expand Up @@ -64,12 +64,8 @@ private static void OnMessageReceived(SocketMessage message)
return;
}

if (TryExecuteMarugame(userMessage)) return;

if (IsContainsTriggerPhrase(userMessage.Content, TriggerType.Silent))
if (TryExecuteMarugame(userMessage))
{
// 黙らせる
DiscordManager.ExecuteAsync<GachaRareReplySupressPresenter>(userMessage).Run();
return;
}

Expand Down

0 comments on commit 5e21260

Please sign in to comment.