-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Slot: スロットを回せる回数に制限をつける * 修正
- Loading branch information
Showing
14 changed files
with
178 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
using Discord.WebSocket; | ||
using Discord; | ||
using Discord.WebSocket; | ||
|
||
namespace Approvers.King.Common; | ||
|
||
public abstract class DiscordMessagePresenterBase : PresenterBase | ||
{ | ||
public SocketUserMessage Message { get; init; } = null!; | ||
|
||
protected override async Task SendAppError(AppException e) | ||
{ | ||
await Message.ReplyAsync(e.Message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace Approvers.King.Common; | ||
|
||
public class AppException(string message) : Exception(message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Approvers.King.Common; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace Approvers.King.Events; | ||
|
||
public class DailyResetPresenter : SchedulerJobPresenterBase | ||
{ | ||
protected override async Task MainAsync() | ||
{ | ||
await using var app = AppService.CreateSession(); | ||
await app.Users.ForEachAsync(user => user.ResetDailySlotExecuteCount()); | ||
await app.SaveChangesAsync(); | ||
|
||
// 排出確率を変える | ||
GachaManager.Instance.RefreshMessageTable(); | ||
GachaManager.Instance.ShuffleRareReplyRate(); | ||
GachaManager.Instance.ShuffleMessageRates(); | ||
await GachaManager.Instance.SaveAsync(); | ||
|
||
// 名前を更新する | ||
await DiscordManager.GetClientUser().ModifyAsync(x => x.Nickname = $"{GachaManager.Instance.RareReplyRate:P0}の確率でわかってくれる創造主"); | ||
|
||
// 排出率を投稿する | ||
await DiscordManager.GetMainChannel().SendMessageAsync(embed: GachaUtility.GetInfoEmbedBuilder().Build()); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Approvers.King.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddSlotDaily : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AddColumn<int>( | ||
name: "TodaySlotExecuteCount", | ||
table: "Users", | ||
type: "INTEGER", | ||
nullable: false, | ||
defaultValue: 0); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropColumn( | ||
name: "TodaySlotExecuteCount", | ||
table: "Users"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters