required => 1
);
+has author_id => (
+ is => 'ro',
+ isa => 'Str',
+ required => 1
+);
+
has discord => (
is => 'ro',
isa => 'Object',
required => 1
);
+has dm_reply => (
+ is => 'rw',
+ isa => 'Bool',
+ required => 0,
+ default => 0
+);
+
sub reply {
my ($self,$msg) = @_;
- $self->message($self->channel_id, $msg);
+ if ($self->dm_reply)
+ {
+ $msg =~ s`<b>(.*?)</b>`**$1**`gi;
+ $msg =~ s`<c(\d+)>(.*?)</c>`*$2*`gi;
+ $self->discord->send_dm($self->author_id, $msg);
+ }
+ else
+ {
+ $self->message($self->channel_id, $msg);
+ }
}
sub message {
$self->bot->discordMessage($target, $msg ); # Send the response.
}
+sub replyId {
+ my $self = shift;
+ return "D-".$self->channel_id;
+}
+
sub _build_uid {
my ($self) = @_;