mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-03-19 01:53:10 +00:00
Asks user to set their eth address after passing a check
This commit is contained in:
parent
ac7aae972c
commit
c630d4c81e
@ -8,7 +8,7 @@ namespace BiblioTech.CodexChecking
|
||||
public interface ICheckResponseHandler
|
||||
{
|
||||
Task CheckNotStarted();
|
||||
Task NowCompleted(ulong userId, string checkName);
|
||||
Task NowCompleted(string checkName);
|
||||
Task GiveRoleReward();
|
||||
|
||||
Task InvalidData();
|
||||
@ -192,7 +192,7 @@ namespace BiblioTech.CodexChecking
|
||||
|
||||
private async Task CheckNowCompleted(ICheckResponseHandler handler, TransferCheck check, ulong userId, string checkName)
|
||||
{
|
||||
await handler.NowCompleted(userId, checkName);
|
||||
await handler.NowCompleted(checkName);
|
||||
|
||||
check.CompletedUtc = DateTime.UtcNow;
|
||||
repo.SaveChanges();
|
||||
|
||||
@ -74,10 +74,24 @@ namespace BiblioTech.Commands
|
||||
await context.Followup("The received data didn't match. Check has failed.");
|
||||
}
|
||||
|
||||
public async Task NowCompleted(ulong userId, string checkName)
|
||||
public async Task NowCompleted(string checkName)
|
||||
{
|
||||
await context.Followup("Successfully completed the check!");
|
||||
await Program.AdminChecker.SendInAdminChannel($"User <@{userId}> has completed check: {checkName}");
|
||||
// check if eth address is known for user.
|
||||
var data = Program.UserRepo.GetUser(user);
|
||||
if (data.CurrentAddress == null)
|
||||
{
|
||||
await context.Followup($"Successfully completed the check!{Environment.NewLine}" +
|
||||
$"You haven't yet set your ethereum address. Consider using '/set' to set it.{Environment.NewLine}" +
|
||||
$"(You can find your address in the 'eth.address' file of your Codex node.)");
|
||||
|
||||
await Program.AdminChecker.SendInAdminChannel($"User <@{user.Id}> has completed check: {checkName}" +
|
||||
$" - EthAddress not set for user. User was reminded.");
|
||||
}
|
||||
else
|
||||
{
|
||||
await context.Followup("Successfully completed the check!");
|
||||
await Program.AdminChecker.SendInAdminChannel($"User <@{user.Id}> has completed check: {checkName}");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ToAdminChannel(string msg)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user