| 1 | package Discord::Client::Model::Channel; | ||||||||||||
| 2 | |||||||||||||
| 3 | 6 | ▶ | use v5.26; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 6 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 6 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 6 | ▶ | use parent 'Discord::Client::Model'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 6 | our $VERSION = '0.003'; | |||||||||||
| 9 | 6 | ▶ | use constant CHANNEL_OBFUSCATED => 1 << 17; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 4 | ▶ | sub name { $_[0]->get('name') } | ||||||||||
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 12 | 1 | ▶ | sub mention { '<#' . $_[0]->id . '>' } | ||||||||||
|
Subroutine
mention: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 13 | 8 | ▶ | sub _has_obfuscated_flag { !!( ( $_[0]->{flags} // 0 ) & CHANNEL_OBFUSCATED ) } | ||||||||||
|
Subroutine
_has_obfuscated_flag: called CC=2 SCAR=6.9
Condition100%2/2
$_[0]{"flags"} // 0
MC/DC100%1/1
$_[0]{"flags"} // 0
$_[0]{"flags"}
Truth table100%2/2
A
A= $_[0]{"flags"}
| |||||||||||||
| 14 | 3 | ▶ | sub is_obfuscated { _has_obfuscated_flag( $_[0]->{data} ) } | ||||||||||
|
Subroutine
is_obfuscated: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 15 | |||||||||||||
| 16 | 3 | ▶ | sub send { | ||||||||||
|
Subroutine
send: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 17 | 3 | my ( $self, $body ) = @_; | |||||||||||
| 18 | |||||||||||||
| 19 | # Use the known channel ID directly; no preliminary channel fetch is necessary. | ||||||||||||
| 20 | 3 | my $request = $self->_call( create_message => $self->id, $body ); | |||||||||||
| 21 | 3 | return $self->_model_future( message => $request ); | |||||||||||
| 22 | } | ||||||||||||
| 23 | |||||||||||||
| 24 | 0 | ▶ | sub fetch_message { | ||||||||||
|
Subroutine
fetch_message: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 25 | 0 | my ( $self, $message_id ) = @_; | |||||||||||
| 26 | |||||||||||||
| 27 | # Turn the fetched resource into a new snapshot sharing this REST client. | ||||||||||||
| 28 | 0 | my $request = $self->_call( get_message => $self->id, $message_id ); | |||||||||||
| 29 | 0 | return $self->_model_future( message => $request ); | |||||||||||
| 30 | } | ||||||||||||
| 31 | |||||||||||||
| 32 | 0 | ▶ | sub typing { | ||||||||||
|
Subroutine
typing: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 33 | 0 | my ($self) = @_; | |||||||||||
| 34 | 0 | return $self->_call( trigger_typing => $self->id ); | |||||||||||
| 35 | } | ||||||||||||
| 36 | |||||||||||||
| 37 | 1 | ▶ | sub refresh { | ||||||||||
|
Subroutine
refresh: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 38 | 1 | my ($self) = @_; | |||||||||||
| 39 | |||||||||||||
| 40 | # Return a replacement snapshot without changing references held by other callers. | ||||||||||||
| 41 | 1 | my $request = $self->_call( get_channel => $self->id ); | |||||||||||
| 42 | 1 | return $self->_model_future( channel => $request ); | |||||||||||
| 43 | } | ||||||||||||
| 44 | |||||||||||||
| 45 | 6 | 1; | |||||||||||
| 46 | |||||||||||||
| 47 | __END__ | ||||||||||||