From bd97afbc3420f6c4157d2a8b75dc2f57d7dab618 Mon Sep 17 00:00:00 2001 From: Veit Progl Date: Wed, 18 Dec 2024 14:15:53 +0100 Subject: [PATCH] move xcode typo to typoCommand --- .../Command/Message Commands/TypoCommand.swift | 3 ++- .../Command/Message Commands/Xcode.swift | 14 -------------- Sources/SwiftDEBot/Commands.swift | 1 - 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Sources/SwiftDEBot/Command/Message Commands/TypoCommand.swift b/Sources/SwiftDEBot/Command/Message Commands/TypoCommand.swift index c2d221f..3c7e09f 100644 --- a/Sources/SwiftDEBot/Command/Message Commands/TypoCommand.swift +++ b/Sources/SwiftDEBot/Command/Message Commands/TypoCommand.swift @@ -6,7 +6,8 @@ struct TypoCommand: MessageCommand { let trigger: [String: [String]] = [ "iPhone": ["Iphone", "ipPhone", "IPhone", "IFöhn"], - "iPad": ["IPad", "Ipad"] + "iPad": ["IPad", "Ipad"], + "Xcode": ["XCode", "xCode"] ] func run(client: DiscordClient, message: Gateway.MessageCreate) async throws { diff --git a/Sources/SwiftDEBot/Command/Message Commands/Xcode.swift b/Sources/SwiftDEBot/Command/Message Commands/Xcode.swift index b44c073..bde602f 100644 --- a/Sources/SwiftDEBot/Command/Message Commands/Xcode.swift +++ b/Sources/SwiftDEBot/Command/Message Commands/Xcode.swift @@ -1,20 +1,6 @@ import DiscordBM import Foundation -struct XcodeTypoCommand: MessageCommand { - let helpText = "" - - func run(client: DiscordClient, message: Gateway.MessageCreate) async throws { - let content = message.content - guard content.contains("XCode") || content.contains("xCode"), - let handle = message.author?.mentionHandle - else { - return - } - try await client.send("Psst \(handle), das schreibt sich Xcode.", to: message.channel_id) - } -} - struct XcodeLatestCommand: MessageCommand { let helpText = "`!xcode`: Was ist die aktuellste Version von Xcode?" diff --git a/Sources/SwiftDEBot/Commands.swift b/Sources/SwiftDEBot/Commands.swift index e9378b3..d7bf2dd 100644 --- a/Sources/SwiftDEBot/Commands.swift +++ b/Sources/SwiftDEBot/Commands.swift @@ -1,7 +1,6 @@ import DiscordBM let messageCommands: [MessageCommand] = [ - XcodeTypoCommand(), XcodeLatestCommand(), SwiftEvolutionCommand(), AppleStatusCommand(),