From 86453daede39ff499415a14f27657a289e7014fc Mon Sep 17 00:00:00 2001 From: nin0dev Date: Fri, 29 Nov 2024 21:31:42 -0500 Subject: [PATCH] Initial commit --- .gitignore | 8 ++ Package.resolved | 159 ++++++++++++++++++++++++++ Package.swift | 23 ++++ Sources/Bot.swift | 32 ++++++ Sources/Commands/RepoManagement.swift | 0 5 files changed, 222 insertions(+) create mode 100644 .gitignore create mode 100644 Package.resolved create mode 100644 Package.swift create mode 100644 Sources/Bot.swift create mode 100644 Sources/Commands/RepoManagement.swift diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0023a53 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +/.build +/Packages +xcuserdata/ +DerivedData/ +.swiftpm/configuration/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..75dbf58 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,159 @@ +{ + "originHash" : "3d28c07a9322f4b5113beb449558e3d98bbcd18d5e1f793fce74c088e5e32263", + "pins" : [ + { + "identity" : "async-http-client", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swift-server/async-http-client.git", + "state" : { + "revision" : "2119f0d9cc1b334e25447fe43d3693c0e60e6234", + "version" : "1.24.0" + } + }, + { + "identity" : "ddbkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/DDBKit/DDBKit", + "state" : { + "revision" : "2016b9559d97950812b2e2f142f461119bbfcdc8", + "version" : "0.2.4" + } + }, + { + "identity" : "discordbm", + "kind" : "remoteSourceControl", + "location" : "https://github.com/DiscordBM/DiscordBM", + "state" : { + "revision" : "42d5c6797ff2a6fff0609030e270bd021f904578", + "version" : "1.12.1" + } + }, + { + "identity" : "multipart-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/multipart-kit.git", + "state" : { + "revision" : "a31236f24bfd2ea2f520a74575881f6731d7ae68", + "version" : "4.7.0" + } + }, + { + "identity" : "swift-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-algorithms.git", + "state" : { + "revision" : "f6919dfc309e7f1b56224378b11e28bab5bccc42", + "version" : "1.2.0" + } + }, + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "cd142fd2f64be2100422d658e7411e39489da985", + "version" : "1.2.0" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections.git", + "state" : { + "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", + "version" : "1.1.4" + } + }, + { + "identity" : "swift-http-types", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-http-types", + "state" : { + "revision" : "ef18d829e8b92d731ad27bb81583edd2094d1ce3", + "version" : "1.3.1" + } + }, + { + "identity" : "swift-log", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-log.git", + "state" : { + "revision" : "96a2f8a0fa41e9e09af4585e2724c4e825410b91", + "version" : "1.6.2" + } + }, + { + "identity" : "swift-nio", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio.git", + "state" : { + "revision" : "dca6594f65308c761a9c409e09fbf35f48d50d34", + "version" : "2.77.0" + } + }, + { + "identity" : "swift-nio-extras", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-extras.git", + "state" : { + "revision" : "2e9746cfc57554f70b650b021b6ae4738abef3e6", + "version" : "1.24.1" + } + }, + { + "identity" : "swift-nio-http2", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-http2.git", + "state" : { + "revision" : "eaa71bb6ae082eee5a07407b1ad0cbd8f48f9dca", + "version" : "1.34.1" + } + }, + { + "identity" : "swift-nio-ssl", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-ssl.git", + "state" : { + "revision" : "c7e95421334b1068490b5d41314a50e70bab23d1", + "version" : "2.29.0" + } + }, + { + "identity" : "swift-nio-transport-services", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-transport-services.git", + "state" : { + "revision" : "bbd5e63cf949b7db0c9edaf7a21e141c52afe214", + "version" : "1.23.0" + } + }, + { + "identity" : "swift-numerics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-numerics.git", + "state" : { + "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", + "version" : "1.0.2" + } + }, + { + "identity" : "swift-syntax", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-syntax", + "state" : { + "revision" : "64889f0c732f210a935a0ad7cda38f77f876262d", + "version" : "509.1.1" + } + }, + { + "identity" : "swift-system", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-system.git", + "state" : { + "revision" : "c8a44d836fe7913603e246acab7c528c2e780168", + "version" : "1.4.0" + } + } + ], + "version" : 3 +} diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..ddd988c --- /dev/null +++ b/Package.swift @@ -0,0 +1,23 @@ +// swift-tools-version: 5.10 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "fj-admin", + dependencies: [ + .package(url: "https://github.com/DDBKit/DDBKit", exact: "0.2.4"), // change this to latest ver + ], + targets: [ + // Targets are the basic building blocks of a package, defining a module or a test suite. + // Targets can depend on other targets in this package and products from dependencies. + .executableTarget( + name: "fj-admin", + dependencies: [ + .product(name: "DDBKit", package: "DDBKit"), + .product(name: "DDBKitUtilities", package: "DDBKit"), + .product(name: "DDBKitFoundation", package: "DDBKit"), + ] + ), + ] +) \ No newline at end of file diff --git a/Sources/Bot.swift b/Sources/Bot.swift new file mode 100644 index 0000000..5f410bb --- /dev/null +++ b/Sources/Bot.swift @@ -0,0 +1,32 @@ +import DDBKit + +@main + +struct FjAdminBot: DiscordBotApp { + init() async { + let httpClient = HTTPClient() + bot = await BotGatewayManager( + eventLoopGroup: httpClient.eventLoopGroup, + httpClient: httpClient, + token: "MTMxMTY2NTg1OTQ3NTAxMzY1Mg.GgVETf.KbMqaqPhOR3JMNT-GiWT3qwiK862cbbjZm9RTc", + largeThreshold: 250, + presence: .init(activities: [], status: .online, afk: false), + intents: [.messageContent, .guildMessages] + ) + cache = await .init( + gatewayManager: bot, + intents: .all, + requestAllMembers: .enabledWithPresences, + messageCachingPolicy: .saveEditHistoryAndDeleted + ) + } + + var body: [any BotScene] { + ReadyEvent { ready in + print("hi mom") + } + } + + var bot: Bot + var cache: Cache +} \ No newline at end of file diff --git a/Sources/Commands/RepoManagement.swift b/Sources/Commands/RepoManagement.swift new file mode 100644 index 0000000..e69de29