Zdgram

Latest version: v0.1.dev7

Safety actively analyzes 688313 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.dev6

**Full Changelog**: https://github.com/x72x/zdgram/compare/0.1.dev5...0.1.dev6

Changelog:
---
+ Add updating messages methods : ( `editMessageText`, `editMessageCaption`, `editMessageMedia`, `editMessageReplyMarkup`, `stopPoll`, `deleteMessage`)

Added sqlite property method to make sqlite3 connector ( **Support messages cache in future** ) , here an example:
---
python
bot.onMessage(text_and_private)
async def on_m(bot: Bot, message: types.Message):
bot.sqlite.execute('''CREATE TABLE IF NOT EXISTS COMPANY
(ID INT PRIMARY KEY NOT NULL,
NAME TEXT NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR(50),
SALARY REAL);''')
bot.sqlite.execute("INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) \
VALUES (1, 'Paul', 32, 'California', 20000.00 )")
await bot.sendMessage(
message.chat.id,
"Done",
reply_to_message_id=message.id
)
bot.sqlite.commit()

---
New methods hint:
editMessageText :
---
- Use this method to edit text and [game](https://core.telegram.org/bots/api#games) messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.

editMessageCaption :
---
- Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.

editMessageMedia :
---
- Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.

editMessageReplyMarkup :
---
- Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.

stopPoll :
- Use this method to stop a poll which was sent by the bot. On success, the stopped [Poll](https://core.telegram.org/bots/api#poll) is returned.

deleteMessage :
---
- Use this method to delete a message, including service messages, with the following limitations:
- A message can only be deleted if it was sent less than 48 hours ago.
- Service messages about a supergroup, channel, or forum topic creation can't be deleted.
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in private chats, groups, and supergroups.
- Bots can delete incoming messages in private chats.
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
Returns True on success

0.1.dev5

**Full Changelog**: https://github.com/x72x/zdgram/commits/0.1.dev5

+ Some code clearing
+ Fix receive last updates with no need to store updates ids
+ Add new methods ( `getChat`, `getChatAdministrators`, `getChatMemberCount`, `getChatMember` )

0.1.dev4

0.1.dev3

**Full Changelog**: https://github.com/x72x/zdgram/compare/0.1.dev2...0.1.dev3

**Changelog: 🥇**
**+ add snake case syntax** (
`send_message`, `send_photo`, `send_sticker`, etc . for [methods](https://github.com/x72x/zdgram/tree/master/zdgram/methods)
`on_message`, `on_callback_query`, `on_inline_query`, etc . for [handlers](https://github.com/x72x/zdgram/tree/master/zdgram/handlers)
)

**+ add new handlers :** `onChatJoinRequest` , `onMyChatMember` , `onChatMember` , `onPoll` , `onPollAnswer` , `onShippingQuery` , `onPreCheckoutQuery`

**+ add Listener method**
- Example to use:
---
python
from zdgram import types, enums, Bot

bot = Bot(bot_token="")

def filter_text_and_private(m: types.Message):
return bool(m.text and m.chat.type == enums.ChatType.PRIVATE)

bot.onMessage(func=filter_text_and_private)
async def on_message(bot: Bot, message: types.Message):
await bot.sendMessage(
message.chat.id,
"Send your name",
reply_to_message_id=message.id
)
msg = await bot.listen(filter_text_and_private)
return await bot.sendMessage(
message.chat.id,
"Your name is : " + msg.text
)


**+ Change package name :**
- The package renamed from "shitgram" to "zdgram"

**+ add inline queries method and types :**
- Added ( `InlineQueryResultArticle`, `InlineQueryResultsButton`, `InputTextMessageContent`, `InputLocationMessageContent`, `InputVenueMessageContent`, `InputContactMessageContent`, `InputInvoiceMessageContent`, `LabeledPrice`, `InlineQueryResultAudio`, `InlineQueryResultGif`, `InlineQueryResultMpeg4Gif`, `InlineQueryResultPhoto`, `InlineQueryResultVideo` and `InlineQueryResultVoice` ) types.
- Added (`answerInlineQuery`, `answer_inline_query` ) . [How to use?](https://github.com/x72x/zdgram/blob/master/examples/inline_queries.py)

**+ more :** add `sendVenue` method, add `allowed_updates`, `disable_notifaction`, `protect_content`, `parse_mode` and `disable_web_page_preview` to `Bot` object, add doc string to methods., use `GET` method instead of `POST` to send requests while no files to upload.

0.1.dev2

**Full Changelog**: https://github.com/x72x/zdgram/compare/0.1.dev2...0.1.dev3

**Changelog: 🥇**
**+ add snake case syntax** (
`send_message`, `send_photo`, `send_sticker`, etc . for [methods](https://github.com/x72x/zdgram/tree/master/zdgram/methods)
`on_message`, `on_callback_query`, `on_inline_query`, etc . for [handlers](https://github.com/x72x/zdgram/tree/master/zdgram/handlers)
)

**+ add new handlers :** `onChatJoinRequest` , `onMyChatMember` , `onChatMember` , `onPoll` , `onPollAnswer` , `onShippingQuery` , `onPreCheckoutQuery`

**+ add Listener method**
- Example to use:
---
python
from zdgram import types, enums, Bot

bot = Bot(bot_token="")

def filter_text_and_private(m: types.Message):
return bool(m.text and m.chat.type == enums.ChatType.PRIVATE)

bot.onMessage(func=filter_text_and_private)
async def on_message(bot: Bot, message: types.Message):
await bot.sendMessage(
message.chat.id,
"Send your name",
reply_to_message_id=message.id
)
msg = await bot.listen(filter_text_and_private)
return await bot.sendMessage(
message.chat.id,
"Your name is : " + msg.text
)


**+ Change package name :**
- The package renamed from "shitgram" to "zdgram"

**+ add inline queries method and types :**
- Added ( `InlineQueryResultArticle`, `InlineQueryResultsButton`, `InputTextMessageContent`, `InputLocationMessageContent`, `InputVenueMessageContent`, `InputContactMessageContent`, `InputInvoiceMessageContent`, `LabeledPrice`, `InlineQueryResultAudio`, `InlineQueryResultGif`, `InlineQueryResultMpeg4Gif`, `InlineQueryResultPhoto`, `InlineQueryResultVideo` and `InlineQueryResultVoice` ) types.
- Added (`answerInlineQuery`, `answer_inline_query` ) . [How to use?](https://github.com/x72x/zdgram/blob/master/examples/inline_queries.py)

**+ more :** add `sendVenue` method, add `allowed_updates`, `disable_notifaction`, `protect_content`, `parse_mode` and `disable_web_page_preview` to `Bot` object, add doc string to methods., use `GET` method instead of `POST` to send requests while no files to upload.

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.