Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amircandy/perlgram
A little library for Telegram Bot API with Perl
https://github.com/amircandy/perlgram
perl telegram-api telegram-bot telegram-bot-api
Last synced: about 1 month ago
JSON representation
A little library for Telegram Bot API with Perl
- Host: GitHub
- URL: https://github.com/amircandy/perlgram
- Owner: AmiRCandy
- License: other
- Created: 2024-02-26T10:17:48.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-02-26T10:41:22.000Z (10 months ago)
- Last Synced: 2024-10-13T11:23:23.268Z (2 months ago)
- Topics: perl, telegram-api, telegram-bot, telegram-bot-api
- Language: Perl
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Perlgram
A library of Telegram Bot API for Perl
## Installation
Install Perlgram with CPAN ( soon )
```bash
cpan install Perlgram
```
## Usage/Examples```perl
use strict;
use warnings;
use lib 'Perlgram/Bot';
use Data::Dumper;
use core;
use parsemode;
use keyboard;my $bot_token = 'Your Token Must Be Here';
my $bot = Perlgram::Bot::core->new($bot_token);$bot->handleUpdates(sub {
my ($update) = @_;
my $parsed = ($update)->{'message'};
if ($parsed->{'text'} eq '/start') { # Use 'eq' for string comparison
print Dumper($bot->sendMessage(
$parsed->{'chat'}->{'id'},
'Hi',
Perlgram::Bot::parsemode->HTML(),
Perlgram::Bot::keyboard->ReplyKeyboardMarkup([
[Perlgram::Bot::keyboard->KeyboardButton('Bye',)]
],\1)
));
}
});```
## Authors
- [@AmiRCandy](https://www.github.com/AmiRCandy)
- Please using my Discord id say the problems to me I will fix them as soon as possible , This is my first Perl project so be sure there is lots of problem
- Coded by ❤️ ;