The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::API::Telegram::InputFile - The contents of a file to be uploaded

SYNOPSIS

        my $msg = Net::API::Telegram::InputFile->new( %data ) || 
        die( Net::API::Telegram::InputFile->error, "\n" );

DESCRIPTION

Net::API::Telegram::InputFile is a Telegram Message Object as defined here https://core.telegram.org/bots/api#inputfile

METHODS

new( {INIT HASH REF}, SCALAR REF | FILE PATH, %PARAMETERS )

new() will create a new object for the package, pass any argument it might receive to the special standard routine init that must exist. It takes one mandatory parameter which is either a scalar for raw data or a file path.

Then it returns what returns init().

The valid parameters are as follow. Methods available here are also parameters to the new method.

  • verbose

  • debug

content( [ DATA ] )

Set or get the raw data for this object.

If no data was set, but a file was set then this will read the file and return its content.

It returns the current content set.

file( [ FILE PATH ] )

Set or get the file path of the file for this object.

This method will perform some basic sanitary checks on the accessibility of the given file path, and its permissions and return error if the file has problems.

It returns the current file set.

save_as( FILE PATH )

Given a file path, this method will save the content of the file in this object to the specified file path.

Before doing so, this method will perform some sanity check on the parent directory to ensure the action can actually be done. It will return an error if problems were found.

COPYRIGHT

Copyright (c) 2000-2019 DEGUEST Pte. Ltd.

CREDITS

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Net::API::Telegram