diff --git a/Bot/Bot.fs b/Bot/Bot.fs index d805084..9057455 100644 --- a/Bot/Bot.fs +++ b/Bot/Bot.fs @@ -61,14 +61,14 @@ let adminBot = new DiscordClient(adminConfig) let hackerCommands = hackerBattleBot.UseSlashCommands() //let jpegCommands = jpegBot.UseSlashCommands() //let stealCommands = stealBot.UseSlashCommands() -//let inviterCommands = inviterBot.UseSlashCommands() +let inviterCommands = inviterBot.UseSlashCommands() //let slotsCommands = slotsBot.UseSlashCommands() let adminCommands = adminBot.UseSlashCommands() hackerCommands.RegisterCommands(guild); //jpegCommands.RegisterCommands(guild); //stealCommands.RegisterCommands(guild); -//inviterCommands.RegisterCommands(guild); +inviterCommands.RegisterCommands(guild); //slotsCommands.RegisterCommands(guild); adminCommands.RegisterCommands(guild) diff --git a/Bot/Bot.fsproj b/Bot/Bot.fsproj index 2e49f6b..95eeab5 100644 --- a/Bot/Bot.fsproj +++ b/Bot/Bot.fsproj @@ -18,13 +18,13 @@ + - diff --git a/Bot/Games/HackerBattle.fs b/Bot/Games/HackerBattle.fs index 136729e..1e35a78 100644 --- a/Bot/Games/HackerBattle.fs +++ b/Bot/Games/HackerBattle.fs @@ -366,7 +366,7 @@ type HackerGame() = [] member this.ScanCommand (ctx : InteractionContext) = enforceChannels (DiscordInteractionContext ctx) scan scan - + // [] member this.TestAutoComplete (ctx : InteractionContext) = async { diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index 49e3e73..80dd53d 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -8,6 +8,8 @@ open DSharpPlus.EventArgs open DSharpPlus.SlashCommands open Degenz.Messaging open Npgsql.FSharp +open Solnet.Rpc +open Solnet.Wallet let connStr = GuildEnvironment.connectionString let InviteRewardAmount = 100 @@ -372,13 +374,24 @@ let handleGuildMemberAdded _ (eventArgs : GuildMemberAddEventArgs) = do! processNewUser eventArgs } :> Task +let submitWhitelist (ctx : IDiscordContext) (address : string) = + task { + // BtshZ7oNB5tk5pVbDpsRCziZ1qwV7SMCJq1Pe3YbHZuo + let address = PublicKey(address) + if address.IsValid() && address.IsOnCurve() then + do! Messaging.sendSimpleResponse ctx "You provided a valid address" + else + do! Messaging.sendSimpleResponse ctx "This address is not valid" + return () + } :> Task + type Inviter() = inherit ApplicationCommandModule () -// [] -// member this.CreateInvite (ctx : InteractionContext) = -// showInviteMessage (DiscordInteractionContext ctx) "RecruitCommand" -// + [] + member this.SubmitAddress (ctx : InteractionContext, [] address : string) = + submitWhitelist (DiscordInteractionContext ctx) address + // [] // member this.ListInvitedPeople (ctx : InteractionContext) = // let ictx = DiscordInteractionContext ctx :> IDiscordContext diff --git a/Bot/paket.references b/Bot/paket.references index 63d3ff0..a301393 100644 --- a/Bot/paket.references +++ b/Bot/paket.references @@ -4,4 +4,5 @@ DSharpPlus.Interactivity DSharpPlus.SlashCommands dotenv.net Npgsql.FSharp -mixpanel-csharp \ No newline at end of file +mixpanel-csharp +Solnet.Rpc \ No newline at end of file diff --git a/paket.dependencies b/paket.dependencies index 25cbd7d..e73ada9 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -12,4 +12,5 @@ nuget DSharpPlus.SlashCommands >= 4.2.0-nightly-01125 nuget MongoDB.Driver nuget dotenv.net 3.1.1 nuget Npgsql.FSharp -nuget mixpanel-csharp 5.0.0 \ No newline at end of file +nuget mixpanel-csharp 5.0.0 +nuget Solnet.Rpc \ No newline at end of file diff --git a/paket.lock b/paket.lock index 166ee7e..10a3974 100644 --- a/paket.lock +++ b/paket.lock @@ -2,6 +2,7 @@ STORAGE: NONE RESTRICTION: || (== net6.0) (== netstandard2.0) (== netstandard2.1) NUGET remote: https://api.nuget.org/v3/index.json + Chaos.NaCl.Standard (1.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) ConcurrentHashSet (1.3) DnsClient (1.6) Microsoft.Win32.Registry (>= 5.0) @@ -30,9 +31,16 @@ NUGET System.Runtime.CompilerServices.Unsafe (>= 5.0) System.ValueTuple (>= 4.5) FSharp.Core (6.0.3) - Microsoft.Bcl.AsyncInterfaces (6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (== netstandard2.1) + Microsoft.Bcl.AsyncInterfaces (6.0) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) Microsoft.Bcl.HashCode (1.1.1) - restriction: || (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) + Microsoft.Extensions.Configuration (6.0.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Microsoft.Extensions.Configuration.Abstractions (>= 6.0) + Microsoft.Extensions.Primitives (>= 6.0) + Microsoft.Extensions.Configuration.Abstractions (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Microsoft.Extensions.Primitives (>= 6.0) + Microsoft.Extensions.Configuration.Binder (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Microsoft.Extensions.Configuration.Abstractions (>= 6.0) Microsoft.Extensions.DependencyInjection (6.0) Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) @@ -41,9 +49,42 @@ NUGET Microsoft.Extensions.DependencyInjection.Abstractions (6.0) Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) + Microsoft.Extensions.Logging (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Microsoft.Extensions.DependencyInjection (>= 6.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) + Microsoft.Extensions.Logging.Abstractions (>= 6.0) + Microsoft.Extensions.Options (>= 6.0) + System.Diagnostics.DiagnosticSource (>= 6.0) Microsoft.Extensions.Logging.Abstractions (6.0.1) System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0) (== netstandard2.1) System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (== netstandard2.0) (== netstandard2.1) + Microsoft.Extensions.Logging.Configuration (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Microsoft.Extensions.Configuration (>= 6.0) + Microsoft.Extensions.Configuration.Abstractions (>= 6.0) + Microsoft.Extensions.Configuration.Binder (>= 6.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) + Microsoft.Extensions.Logging (>= 6.0) + Microsoft.Extensions.Logging.Abstractions (>= 6.0) + Microsoft.Extensions.Options (>= 6.0) + Microsoft.Extensions.Options.ConfigurationExtensions (>= 6.0) + Microsoft.Extensions.Logging.Console (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) + Microsoft.Extensions.Logging (>= 6.0) + Microsoft.Extensions.Logging.Abstractions (>= 6.0) + Microsoft.Extensions.Logging.Configuration (>= 6.0) + Microsoft.Extensions.Options (>= 6.0) + System.Text.Json (>= 6.0) + Microsoft.Extensions.Options (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) + Microsoft.Extensions.Primitives (>= 6.0) + Microsoft.Extensions.Options.ConfigurationExtensions (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Microsoft.Extensions.Configuration.Abstractions (>= 6.0) + Microsoft.Extensions.Configuration.Binder (>= 6.0) + Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0) + Microsoft.Extensions.Options (>= 6.0) + Microsoft.Extensions.Primitives (>= 6.0) + Microsoft.Extensions.Primitives (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + System.Runtime.CompilerServices.Unsafe (>= 6.0) Microsoft.NETCore.Platforms (6.0.2) Microsoft.NETCore.Targets (5.0) Microsoft.Win32.Primitives (4.3) @@ -88,6 +129,7 @@ NUGET Ply (0.3.1) FSharp.Core (>= 4.6.2) System.Threading.Tasks.Extensions (>= 4.5.4) + Portable.BouncyCastle (1.9) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) @@ -134,6 +176,13 @@ NUGET SharpCompress (0.30.1) System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (&& (== netstandard2.1) (>= net461)) System.Text.Encoding.CodePages (>= 5.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (== netstandard2.1) + Solnet.Rpc (6.0.10) + Microsoft.Extensions.Logging (>= 6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Microsoft.Extensions.Logging.Console (>= 6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Solnet.Wallet (>= 6.0.10) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Solnet.Wallet (6.0.10) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Chaos.NaCl.Standard (>= 1.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) + Portable.BouncyCastle (>= 1.9) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) System.Buffers (4.5.1) System.Collections (4.3) Microsoft.NETCore.Platforms (>= 1.1) @@ -158,7 +207,6 @@ NUGET Microsoft.NETCore.Targets (>= 1.1) System.Runtime (>= 4.3) System.Diagnostics.DiagnosticSource (6.0) - System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< net5.0)) (== netstandard2.0) (== netstandard2.1) System.Runtime.CompilerServices.Unsafe (>= 6.0) System.Diagnostics.Tracing (4.3) Microsoft.NETCore.Platforms (>= 1.1) @@ -328,7 +376,7 @@ NUGET System.Threading (>= 4.3) System.Threading.Tasks (>= 4.3) System.Threading.Timer (>= 4.3) - System.Numerics.Vectors (4.5) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (== netstandard2.1) + System.Numerics.Vectors (4.5) - restriction: || (&& (== net6.0) (< netcoreapp2.0) (< netstandard2.1)) (&& (== net6.0) (< netstandard2.0)) (== netstandard2.0) (&& (== netstandard2.1) (< netstandard2.0)) System.Reflection (4.3) Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Targets (>= 1.1) @@ -487,18 +535,11 @@ NUGET Microsoft.NETCore.Targets (>= 1.1) System.Runtime (>= 4.3) System.Text.Encoding (>= 4.3) - System.Text.Encodings.Web (6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (== netstandard2.1) - System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1) - System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1) + System.Text.Encodings.Web (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0)) System.Runtime.CompilerServices.Unsafe (>= 6.0) - System.Text.Json (6.0.2) - restriction: || (&& (== net6.0) (< netcoreapp3.1)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0) (== netstandard2.1) - Microsoft.Bcl.AsyncInterfaces (>= 6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1) - System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1) - System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1) - System.Numerics.Vectors (>= 4.5) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1) + System.Text.Json (6.0.2) System.Runtime.CompilerServices.Unsafe (>= 6.0) System.Text.Encodings.Web (>= 6.0) - System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0) (== netstandard2.1) System.Threading (4.3) System.Runtime (>= 4.3) System.Threading.Tasks (>= 4.3)