Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add helpful ruby reaction command #32

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Sources/SwiftDEBot/Command/Message Commands/Ruby.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import DiscordBM
import Foundation

struct RubyCommand: MessageCommand {
let helpText = ""

func run(client: DiscordClient, message: Gateway.MessageCreate) async throws {
let content = message.content.lowercased()
guard content.contains("ruby") || content.contains("cocoapods") || content.contains("fastlane"),
let handle = message.author?.mentionHandle
else {
return
}
try await client.addReaction(
.guildEmoji(name: "fckrby", id: "1174327414470496276"), to: message.message_id, in: message.channel_id)
}
}
1 change: 1 addition & 0 deletions Sources/SwiftDEBot/Commands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let messageCommands: [MessageCommand] = [
AppleStatusCommand(),
SPICommand(),
SummarizeCommand(),
RubyCommand(),

CowsCommand(),

Expand Down
Loading