Skip to content

Commit

Permalink
Use more precise description in ReactCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Jun 20, 2024
1 parent eeda76f commit 43781eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/D2Commands/Moderation/ReactCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import Utils
fileprivate let argsPattern = #/(?<messageId>\d+)\s+(?<channelId>\d+)\s+:?(?<emoji>[^:\s]+):?/#

public class ReactCommand: StringCommand {
public let info = CommandInfo(
public private(set) var info = CommandInfo(
category: .moderation,
shortDescription: "Reacts to a message",
helpText: "Syntax: [message id] [channel id] [emoji name]",
requiredPermissionLevel: .admin
)
private let timer: RepeatingTimer?

public init(temporary: Bool = false) {
info.shortDescription = "Reacts to a message\(temporary ? " temporarily" : "")"
info.longDescription = info.shortDescription

if temporary {
timer = RepeatingTimer(interval: .seconds(5))
} else {
Expand Down

0 comments on commit 43781eb

Please sign in to comment.