Skip to main content

This library from easy work with aiogram

Project description

aiodgram

What is this?

The module makes it easier for you to use the basic functions of AIOGRAM, such as sending messages/photos/video and start your bot.

Using

Let's import it first: First, import class TgBot and types from the library (use the 'from ... import TgBot, types' construct). Second, create a object from class TgBot (use 'name = TgBot()' construct) Third, You must write arguments to this object, token: string, admin_username: string

from `...` import TgBot

bot = TgBot(`token`, `admin_username`)

AFTER object_botname = bot

Use in asyng defines

Examples:

@`bot`.dispatcher.message_handler()
async def test:
  await bot.send_message(`chat_id`, `text`)

or

@`bot`.dispatcher.message_handler()
async def test:
  await bot.send_photo(`chat_id`, `photo_url`, caption=`text`)

or

@`bot`.dispatcher.message_handler()
async def test:
  await bot.send_video(`chat_id`, `video_url`, caption=`text`)

Beautiful messages to console

You can create your beautiful messages to console with color!

First, import class MyMessages from the library (use the 'from ... import MyMessages' construct)

Second, create a object from class MyMessages (use 'name = MyMessage()' construct)

Third, you must use a message define based on this object (use, 'name.message()' construct)

Fourth, You must write arguments to this define, clear: bool, message:string, colors:list.

Example:

from `...` import MyMessages

my_msg = MyMessage()

print(my_msg.message(clear=`bool`, text=`text`, color=`[green, blue]`))

Download a videos from YouTube

You can download a video from YouTube using this library!

First, import class DownloadVideo from the library (use the 'from ... import DownloadVideo' construct)

Second, create a object from class DownloadVideo (use 'name = DownloadVideo()' construct)

Third, you must use a Download_This_Video define based on this object (use, 'name.Download_This_Video()' construct)

Fourth, you must write arguments to this define, link_on_video: string, video_name: string, resolution: int

Example:

from `...` import DownloadVideo

video = DownloadVideo()

video.download_This_Video(link_on_video=`link`, video_name=`name of file`, resolution=`720p`)

Create your buttons

You can create buttons for your messages!

For reply_markup

Example:

from `...` import Button

btns = Button()

keyboard = [
  [
    btns.add_button(`text`)
  ],
  [
    btns.add_button(`text`)
  ]
]

reply_btns = btns.add_markup(keyboard)

And, you must add object from fourth point to send_message ; send_photo ; send_video in reply_markup argument

For inline_markup

Example:

from `...` import Button

btns = Button()

keyboard = [
  [
    btns.add_inline_button(`text`, `callback`)
  ],
  [
    btns.add_inline_button(`text`, `callback`)
  ]
]

reply_btns = btns.add_inline_markup(keyboard)

And, you must add object from fourth point to send_message or send_photo or send_video in reply_markup argument

Show loading animation in your bot

First, you must use a define from TgBot (use 'name your object TgBot.loading()')

Second, you must write argumets to this define, chat_id: int, percentages: int

Example:

bot = TgBot(`token`)

@`bot`.dispatcher.message_handler()
async def test:
  await bot.loading(`chat_id`, `percentages`)

For start your bot, you need

bot.start_polling(dispatcher=bot Dispatcher, skip_updates=True or False, on_startup=define for start, on_shutdown=define for shutdown).

Example:

from `...` import TgBot
bot = TgBot()

bot.start_polling(`nothing arguments or your arguments`)

Easy work with SQL

Create columns in DB

Example:

from `...` import Database

db = Database(`filename db`)

db.create_data(`table`, columns=`list`, values=`list`) #Creating a cell in a DB table

db.select_data(`table`, column=`str`, search_column=`str`, search_data=`str`) #Return list with your datas

db.edit_data(`table`, column=`str`, new_data=`any`, search_column=`str`, search_data=`str`) #Edit data in your DB

db.delete_data(`table`, search_column=`str`, search_data=`str`) #Delete data fro DB

Developers

authors: Darkangel, Arkeep

authors telegrams: t.me/darkangel58414 and t.me/Stillcrayg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

aiodgram-1.6.10-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file aiodgram-1.6.10-py3-none-any.whl.

File metadata

  • Download URL: aiodgram-1.6.10-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for aiodgram-1.6.10-py3-none-any.whl
Algorithm Hash digest
SHA256 e1fd322eff91d3d5973297b1f6fa4f04efe5390e263a0a9735fde26b6338574a
MD5 0ec1caa9ee53987b76fb8287436924a4
BLAKE2b-256 69a8a01923e367ac1840133002cc3c9dd846a2385fc51df4eda1cf71df4c5970

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page