aiodgram


Nameaiodgram JSON
Version 2.4.3 PyPI version JSON
download
home_page
SummaryThis library from easy work with aiogram
upload_time2024-01-17 15:47:32
maintainer
docs_urlNone
authorDarkangel, Arkeep
requires_python>=3.9
license
keywords telegram aiogram aiodgram
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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`

```python
from `...` import TgBot

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



AFTER `object_botname` = `bot`

## Use in asyng defines

Examples:

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

or

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

or

```python
@`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*:`string`.

Example:

```python
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:

```python
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:

```python
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:

```python
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 '`bot`.loading()')

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

Example:

```python
bot = TgBot(`token`)

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




## Easy work with SQL

Example:

```python
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
```




## Your custom exceptions

Example:

```python
from `...` import MyException

MyException(message='', extra_info=any)
```



## Logging your project

Example:

```python
from `...` import Logged

`log` = Logged(type_logging='info', filename='log.log')

`log`.info(message='')
`log`.error(message='')
`log`.warning(message='')
`log`.critical(message='')
`log`.debug(message='')

```




## Password maker

Example:
```python
from `...` import PasswordMaker, TgBot, types
bot = TgBot(`token`, `admin_username`)

password = PasswordMaker(bot=bot)

@bot.dispatcher.message_handler()
async def password_maker(message: types.Message):
  await password.make(message.from_user.id, 'Input a password lenght')

```


## Edit text in your message

Example:
```python
from `...` inport TgBot

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

@dp.message_handler()
async def a(message: types.Message):
  text = message.text
  chat_id = message.chat.id

  await bot.edit_message_text(text=text, chat_id=chat_id)


```


## Edit inline markup in your message

Example:
```python
from `...` inport TgBot

bot = TgBot(`token`, `admin_username`)
your_inline_markup = 'your markup'

@dp.message_handler()
async def a(message: types.Message):
  chat_id = message.chat.id
  message_id = message.message_id

  await bot.edit_message_markup(chat_id=chat_id, message_id=message_id, reply_markup=your_inline_markup)


```



## 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:

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

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




# Developers
authors: `Darkangel, Arkeep`

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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "aiodgram",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "telegram aiogram aiodgram",
    "author": "Darkangel, Arkeep",
    "author_email": "fvovva@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "# aiodgram \n\n## What is this? \nThe module makes it easier for you to use the basic functions of AIOGRAM, such as sending messages/photos/video and start your bot.\n\n\n\n## Using \n\nLet's import it first:\nFirst, import class `TgBot and types` from the library (use the 'from `...` import TgBot, types' construct).\nSecond, create a object from class `TgBot` (use '`name` = TgBot()' construct)\nThird, You must write arguments to this object, *token*: `string`, *admin_username*: `string`\n\n```python\nfrom `...` import TgBot\n\nbot = TgBot(`token`, `admin_username`)\n```\n\n\n\nAFTER `object_botname` = `bot`\n\n## Use in asyng defines\n\nExamples:\n\n```python\n@`bot`.dispatcher.message_handler()\nasync def test:\n  await bot.send_message(`chat_id`, `text`)\n```\n\nor\n\n```python\n@`bot`.dispatcher.message_handler()\nasync def test:\n  await bot.send_photo(`chat_id`, `photo_url`, caption=`text`)\n```\n\nor\n\n```python\n@`bot`.dispatcher.message_handler()\nasync def test:\n  await bot.send_video(`chat_id`, `video_url`, caption=`text`)\n```\n\n\n\n## Beautiful messages to console \n\nYou can create your beautiful messages to console with color!\n\nFirst, import class `MyMessages` from the library (use the 'from `...` import MyMessages' construct)\n\nSecond, create a object from class `MyMessages` (use '`name` = MyMessage()' construct)\n\nThird, you must use a `message` define based on this object (use, '`name`.message()' construct)\n\nFourth, You must write arguments to this define, *clear*: `bool`, *message*:`string`, *colors*:`string`.\n\nExample:\n\n```python\nfrom `...` import MyMessages\n\nmy_msg = MyMessage()\n\nprint(my_msg.message(clear=`bool`, text=`text`, color=`[green, blue]`))\n```\n\n\n\n## Download a videos from YouTube \n\nYou can download a video from YouTube using this library!\n\nFirst, import class `DownloadVideo` from the library (use the 'from `...` import DownloadVideo' construct)\n\nSecond, create a object from class `DownloadVideo` (use '`name` = DownloadVideo()' construct)\n\nThird, you must use a `Download_This_Video` define based on this object (use, '`name`.Download_This_Video()' construct)\n\nFourth, you must write arguments to this define, *link_on_video*: `string`, *video_name*: `string`, *resolution*: `int` \n\n\n\nExample:\n\n```python\nfrom `...` import DownloadVideo\n\nvideo = DownloadVideo()\n\nvideo.download_This_Video(link_on_video=`link`, video_name=`name of file`, resolution=`720p`)\n```\n\n\n\n\n\n## Create your buttons \n\nYou can create buttons for your messages!\n\n### For reply_markup\nExample:\n\n```python\nfrom `...` import Button\n\nbtns = Button()\n\nkeyboard = [\n  [\n    btns.add_button(`text`)\n  ],\n  [\n    btns.add_button(`text`)\n  ]\n]\n\nreply_btns = btns.add_markup(keyboard)\n```\n\nAnd, you must add object from fourth point to `send_message` ; `send_photo` ; `send_video` in `reply_markup` argument\n\n\n\n\n### For inline_markup\n\nExample:\n\n```python\nfrom `...` import Button\n\nbtns = Button()\n\nkeyboard = [\n  [\n    btns.add_inline_button(`text`, `callback`)\n  ],\n  [\n    btns.add_inline_button(`text`, `callback`)\n  ]\n]\n\nreply_btns = btns.add_inline_markup(keyboard)\n```\n\nAnd, you must add object from fourth point to `send_message` or `send_photo` or `send_video` in `reply_markup` argument\n\n\n\n\n## Show loading animation in your bot\nFirst, you must use a define from TgBot (use '`bot`.loading()')\n\nSecond, you must write argumets to this define, *chat_id*: `int`, *percentages*: `int`\n\nExample:\n\n```python\nbot = TgBot(`token`)\n\n@`bot`.dispatcher.message_handler()\nasync def test:\n  await bot.loading(`chat_id`, `percentages`)\n```\n\n\n\n\n## Easy work with SQL\n\nExample:\n\n```python\nfrom `...` import Database\n\ndb = Database(`filename db`)\n\ndb.create_data(`table`, columns=`list`, values=`list`) #Creating a cell in a DB table\n\ndb.select_data(`table`, column=`str`, search_column=`str`, search_data=`str`) #Return list with your datas\n\ndb.edit_data(`table`, column=`str`, new_data=`any`, search_column=`str`, search_data=`str`) #Edit data in your DB\n\ndb.delete_data(`table`, search_column=`str`, search_data=`str`) #Delete data fro DB\n```\n\n\n\n\n## Your custom exceptions\n\nExample:\n\n```python\nfrom `...` import MyException\n\nMyException(message='', extra_info=any)\n```\n\n\n\n## Logging your project\n\nExample:\n\n```python\nfrom `...` import Logged\n\n`log` = Logged(type_logging='info', filename='log.log')\n\n`log`.info(message='')\n`log`.error(message='')\n`log`.warning(message='')\n`log`.critical(message='')\n`log`.debug(message='')\n\n```\n\n\n\n\n## Password maker\n\nExample:\n```python\nfrom `...` import PasswordMaker, TgBot, types\nbot = TgBot(`token`, `admin_username`)\n\npassword = PasswordMaker(bot=bot)\n\n@bot.dispatcher.message_handler()\nasync def password_maker(message: types.Message):\n  await password.make(message.from_user.id, 'Input a password lenght')\n\n```\n\n\n## Edit text in your message\n\nExample:\n```python\nfrom `...` inport TgBot\n\nbot = TgBot(`token`, `admin_username`)\n\n@dp.message_handler()\nasync def a(message: types.Message):\n  text = message.text\n  chat_id = message.chat.id\n\n  await bot.edit_message_text(text=text, chat_id=chat_id)\n\n\n```\n\n\n## Edit inline markup in your message\n\nExample:\n```python\nfrom `...` inport TgBot\n\nbot = TgBot(`token`, `admin_username`)\nyour_inline_markup = 'your markup'\n\n@dp.message_handler()\nasync def a(message: types.Message):\n  chat_id = message.chat.id\n  message_id = message.message_id\n\n  await bot.edit_message_markup(chat_id=chat_id, message_id=message_id, reply_markup=your_inline_markup)\n\n\n```\n\n\n\n## For start your bot, you need\n\nbot.start_polling(dispatcher=`bot Dispatcher`, skip_updates=`True or False`, on_startup=`define for start`, on_shutdown=`define for shutdown`).\n\n\n\nExample:\n\n```python\nfrom `...` import TgBot\nbot = TgBot()\n\nbot.start_polling(`nothing arguments or your arguments`)\n```\n\n\n\n\n# Developers\nauthors: `Darkangel, Arkeep`\n\nauthors telegrams: `t.me/darkangel58414` and `t.me/Stillcrayg`\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "This library from easy work with aiogram",
    "version": "2.4.3",
    "project_urls": null,
    "split_keywords": [
        "telegram",
        "aiogram",
        "aiodgram"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fe62ec338e75513ec7e6e846b4d6886181f8c17800b09eef93488d0342892c40",
                "md5": "c6b0faa325f6b2449fa119c61658d592",
                "sha256": "f0e5cd2ea55abb6192d98b5ecd257febcbfb3a95a7eb61fddad61a1af1be1d13"
            },
            "downloads": -1,
            "filename": "aiodgram-2.4.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c6b0faa325f6b2449fa119c61658d592",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 17351,
            "upload_time": "2024-01-17T15:47:32",
            "upload_time_iso_8601": "2024-01-17T15:47:32.094736Z",
            "url": "https://files.pythonhosted.org/packages/fe/62/ec338e75513ec7e6e846b4d6886181f8c17800b09eef93488d0342892c40/aiodgram-2.4.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-17 15:47:32",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "aiodgram"
}
        
Elapsed time: 4.14614s