Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.3.2 #15

Open
wants to merge 143 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
c7f1528
add User class
HexyeDEV Jan 18, 2023
b775dc1
Restyled by autopep8
restyled-commits Jan 18, 2023
1cdf86a
Restyled by black
restyled-commits Jan 18, 2023
fa97fd9
Restyled by isort
restyled-commits Jan 18, 2023
c2e574c
Restyled by yapf
restyled-commits Jan 18, 2023
1ea736f
Merge pull request #16 from HexyeDEV/restyled/v0.3.2
HexyeDEV Jan 18, 2023
4c42eaf
add ReplyMarkupKeyboard
HexyeDEV Feb 4, 2023
c5b8999
Merge branch 'v0.3.2' of https://github.com/HexyeDEV/EzTg into v0.3.2
HexyeDEV Feb 4, 2023
efdc88a
update getMe according to user class
HexyeDEV Feb 17, 2023
14f868d
Restyled by autopep8
restyled-commits Feb 17, 2023
0277867
Restyled by black
restyled-commits Feb 17, 2023
4221b6f
Restyled by yapf
restyled-commits Feb 17, 2023
35f377d
Merge pull request #17 from HexyeDEV/restyled/v0.3.2
HexyeDEV Feb 18, 2023
b269981
Create LICENSE
HexyeDEV Mar 1, 2023
6e4d5e6
Restyled by autopep8
restyled-commits Mar 1, 2023
3c441d4
Restyled by black
restyled-commits Mar 1, 2023
13648bb
Restyled by yapf
restyled-commits Mar 1, 2023
0d665b4
Merge pull request #18 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 1, 2023
7b40f05
fix ReplyKeyboardMarkup
HexyeDEV Mar 5, 2023
c5d21f6
Merge branch 'v0.3.2' of https://github.com/HexyeDEV/EzTg into v0.3.2
HexyeDEV Mar 5, 2023
74d0773
fix ReplyKeyboardMarkup (again)
HexyeDEV Mar 5, 2023
4cd1a27
Add Chat class and related methods
HexyeDEV Mar 5, 2023
761b008
.
HexyeDEV Mar 5, 2023
a9ebd20
Restyled by autopep8
restyled-commits Mar 5, 2023
0232303
Restyled by black
restyled-commits Mar 5, 2023
c5c4499
Restyled by isort
restyled-commits Mar 5, 2023
8a1d583
Restyled by yapf
restyled-commits Mar 5, 2023
06a5e4e
Merge pull request #19 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 5, 2023
931da9a
Add ChatPhoto class #20 and User class refactor
HexyeDEV Mar 5, 2023
0d51885
Merge branch 'v0.3.2' of https://github.com/HexyeDEV/EzTg into v0.3.2
HexyeDEV Mar 5, 2023
a384d6b
Restyled by autopep8
restyled-commits Mar 5, 2023
5ba44dd
Restyled by black
restyled-commits Mar 5, 2023
5fede70
Restyled by yapf
restyled-commits Mar 5, 2023
c64b30d
Merge pull request #21 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 5, 2023
c762b08
add Message class #20
HexyeDEV Mar 5, 2023
e134d61
Merge branch 'v0.3.2' of https://github.com/HexyeDEV/EzTg into v0.3.2
HexyeDEV Mar 5, 2023
541ee64
Restyled by autopep8
restyled-commits Mar 5, 2023
13de86f
Restyled by black
restyled-commits Mar 5, 2023
def94db
Restyled by isort
restyled-commits Mar 5, 2023
8034932
Restyled by yapf
restyled-commits Mar 5, 2023
aabb4a2
Merge pull request #22 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 5, 2023
12cb333
add ChatPermissions class
HexyeDEV Mar 5, 2023
24091c5
Merge branch 'v0.3.2' of https://github.com/HexyeDEV/EzTg into v0.3.2
HexyeDEV Mar 5, 2023
ddea2af
Restyled by autopep8
restyled-commits Mar 5, 2023
beb4c47
Restyled by black
restyled-commits Mar 5, 2023
009d9eb
Restyled by isort
restyled-commits Mar 5, 2023
7f93148
Restyled by yapf
restyled-commits Mar 5, 2023
d4c95a1
Merge pull request #23 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 5, 2023
05b3a5e
add ChatLocation and Location class #20
HexyeDEV Mar 5, 2023
ac0f627
implement ChatLocation in Chat class #20
HexyeDEV Mar 5, 2023
5dd6dae
changes for #20
HexyeDEV Mar 5, 2023
abb0135
Merge
HexyeDEV Mar 5, 2023
9197ab8
Restyled by autopep8
restyled-commits Mar 5, 2023
1a5453b
Restyled by black
restyled-commits Mar 5, 2023
7e7140a
Restyled by isort
restyled-commits Mar 5, 2023
21bb668
Restyled by yapf
restyled-commits Mar 5, 2023
31df411
Merge pull request #24 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 5, 2023
c770bd6
Message class update for Location #25 + small fix
HexyeDEV Mar 5, 2023
c47f003
Restyled by autopep8
restyled-commits Mar 5, 2023
8b81df9
Restyled by black
restyled-commits Mar 5, 2023
5b7abde
Restyled by isort
restyled-commits Mar 5, 2023
d5add39
Restyled by yapf
restyled-commits Mar 5, 2023
7f99dd7
Merge pull request #26 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 5, 2023
6cdf58e
add Animation class #25
HexyeDEV Mar 6, 2023
9ffb263
add PhotoSize for Animation class #25
HexyeDEV Mar 6, 2023
a5c6169
Restyled by autopep8
restyled-commits Mar 6, 2023
4bf9be5
Restyled by black
restyled-commits Mar 6, 2023
dc69650
Restyled by yapf
restyled-commits Mar 6, 2023
14fd365
Merge pull request #27 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 6, 2023
6df2ba3
fix photosize import
HexyeDEV Mar 6, 2023
e7e74db
Merge branch 'v0.3.2' of https://github.com/HexyeDEV/EzTg into v0.3.2
HexyeDEV Mar 6, 2023
cdf1051
add Audio class #25
HexyeDEV Mar 6, 2023
a457f16
Restyled by autopep8
restyled-commits Mar 6, 2023
153f14a
Restyled by black
restyled-commits Mar 6, 2023
06c80fa
Restyled by yapf
restyled-commits Mar 6, 2023
b77b1f8
Merge pull request #28 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 6, 2023
c32eded
add Document class #25
HexyeDEV Mar 6, 2023
91c0152
Merge branch 'v0.3.2' of https://github.com/HexyeDEV/EzTg into v0.3.2
HexyeDEV Mar 6, 2023
e03c366
Restyled by autopep8
restyled-commits Mar 6, 2023
dac4802
Restyled by black
restyled-commits Mar 6, 2023
a1ea4f0
Restyled by yapf
restyled-commits Mar 6, 2023
4884819
Merge pull request #29 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 6, 2023
99632c6
little message class fix #25
HexyeDEV Mar 6, 2023
560935b
Merge branch 'v0.3.2' of https://github.com/HexyeDEV/EzTg into v0.3.2
HexyeDEV Mar 6, 2023
31c9e83
add jetbrains contribuition
HexyeDEV Mar 7, 2023
587b1c5
Restyled by autopep8
restyled-commits Mar 7, 2023
bbe25d0
Restyled by black
restyled-commits Mar 7, 2023
a6f0fb3
Restyled by whitespace
restyled-commits Mar 7, 2023
3ba8f5f
Restyled by yapf
restyled-commits Mar 7, 2023
6c1f675
Merge pull request #30 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 7, 2023
6ef71cd
Update README.rst
HexyeDEV Mar 7, 2023
877ce98
solve ciruclar import + add Video class #25
HexyeDEV Mar 7, 2023
cfcb2da
Merge branch 'v0.3.2' of https://github.com/HexyeDEV/EzTg into v0.3.2
HexyeDEV Mar 7, 2023
39d3604
Restyled by autopep8
restyled-commits Mar 7, 2023
24f6325
Restyled by black
restyled-commits Mar 7, 2023
6a24a40
Restyled by yapf
restyled-commits Mar 7, 2023
d4a44e5
Merge pull request #31 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 7, 2023
52afdad
fix docs and add replymarkupkeyboard to setup
HexyeDEV Mar 7, 2023
a7c3214
Merge branch 'v0.3.2' of https://github.com/HexyeDEV/EzTg into v0.3.2
HexyeDEV Mar 7, 2023
4f91912
edit docs config
HexyeDEV Mar 7, 2023
e9265b8
testing shi
HexyeDEV Mar 24, 2023
e17b39e
trying other shi
HexyeDEV Mar 24, 2023
9dcc160
trying shi again
HexyeDEV Mar 24, 2023
def6151
add VideoNote class #25
HexyeDEV Mar 24, 2023
442bba3
Restyled by autopep8
restyled-commits Mar 24, 2023
b81e5d6
Restyled by black
restyled-commits Mar 24, 2023
f6806bd
Restyled by yapf
restyled-commits Mar 24, 2023
abee3bf
Merge pull request #32 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 24, 2023
a975f68
Update README.rst
HexyeDEV Mar 24, 2023
e89973a
Update SECURITY.md
HexyeDEV Mar 24, 2023
d7aeb84
Update README.rst
HexyeDEV Mar 24, 2023
fc4437d
Restyled by autopep8
restyled-commits Mar 24, 2023
7ff5be0
Restyled by black
restyled-commits Mar 24, 2023
13a19f7
Restyled by prettier-markdown
restyled-commits Mar 24, 2023
023f6dd
Restyled by yapf
restyled-commits Mar 24, 2023
ed60f48
Merge pull request #33 from HexyeDEV/restyled/v0.3.2
HexyeDEV Mar 24, 2023
8b47904
restyle (hope docs work)
HexyeDEV Mar 26, 2023
4c371d1
Merge branch 'v0.3.2' of https://github.com/HexyeDEV/EzTg into v0.3.2
HexyeDEV Mar 26, 2023
33dc957
maybe fix docs
HexyeDEV Mar 26, 2023
3223915
add missing docstrings
HexyeDEV Mar 27, 2023
f005e7b
add Voice class #25
HexyeDEV May 26, 2023
d619e46
add MessageEntity class #25
HexyeDEV May 26, 2023
b32db35
Restyled by autopep8
restyled-commits May 26, 2023
5f40a2c
Restyled by black
restyled-commits May 26, 2023
acad7f7
Restyled by isort
restyled-commits May 26, 2023
1072c79
Restyled by yapf
restyled-commits May 26, 2023
c1e7c2e
Merge pull request #34 from HexyeDEV/restyled/v0.3.2
HexyeDEV May 26, 2023
95959e0
add contact class
HexyeDEV Jun 29, 2023
ee3883e
add Dice class #25
HexyeDEV Jun 29, 2023
997a770
add Game class #25
HexyeDEV Jun 29, 2023
107a625
fix exceptions not handles
HexyeDEV Jun 29, 2023
71a02fa
add Poll Full message class implementation #25
HexyeDEV Jun 29, 2023
5080a0b
add Venue class #25
HexyeDEV Jun 29, 2023
02f9a42
add Sticker class #25
HexyeDEV Jun 29, 2023
68b850f
added inlinekeyboard to be added to message
HexyeDEV Jun 29, 2023
a80b659
update message init
HexyeDEV Jun 29, 2023
6040d05
Restyled by autopep8
restyled-commits Jun 29, 2023
d0b0d16
Restyled by black
restyled-commits Jun 29, 2023
4a8300c
Restyled by isort
restyled-commits Jun 29, 2023
6c58429
Restyled by yapf
restyled-commits Jun 29, 2023
f4b1e29
Merge pull request #35 from HexyeDEV/restyled/v0.3.2
HexyeDEV Jun 29, 2023
8bc730c
Add MessageAutoDeleteTimerChanged #25
HexyeDEV Aug 20, 2023
f24b216
added many classes #25
HexyeDEV Jan 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restyled by yapf
restyled-commits committed Jan 18, 2023
commit c2e574c12d42e388c69f8e8028299573c43077db
49 changes: 25 additions & 24 deletions EzTg/main.py
Original file line number Diff line number Diff line change
@@ -5,18 +5,13 @@


class Parse(dict):

def __getattr__(*args):
args = dict.get(*args)

return (
Parse(args)
if isinstance(args, dict)
else [
[Parse(y) for y in x] if isinstance(x, list) else Parse(x) for x in args
]
if isinstance(args, list)
else args
)
return (Parse(args) if isinstance(args, dict) else
[[Parse(y) for y in x] if isinstance(x, list) else Parse(x)
for x in args] if isinstance(args, list) else args)

__setattr__ = dict.__setitem__

@@ -28,11 +23,10 @@ class TokenError(Exception):


class TelegramClient:

def __init__(self, token):
if (
requests.get("https://api.telegram.org/bot" + token + "/getMe").json()["ok"]
== False
):
if (requests.get("https://api.telegram.org/bot" + token +
"/getMe").json()["ok"] == False):
raise TokenError("The token you provided is wrong")
else:
self.token = token
@@ -47,9 +41,9 @@ async def send(self, method, **kwargs):
The method you want to use.
\*\*kwargs: `dict`
The parameters you want to send to the method."""
async with aiohttp.request(
"POST", self.api.format(self.token, method), json=kwargs
) as response:
async with aiohttp.request("POST",
self.api.format(self.token, method),
json=kwargs) as response:
r = await response.json()
return Parse(r)

@@ -135,7 +129,9 @@ async def deleteMessage(self, chat_id, message_id):
The chat id you want to delete the message from.
message_id: `int`
The message id you want to delete."""
return await self.send("deleteMessage", chat_id=chat_id, message_id=message_id)
return await self.send("deleteMessage",
chat_id=chat_id,
message_id=message_id)

async def editMessageText(
self,
@@ -192,9 +188,11 @@ async def editMessageText(
disable_web_page_preview=disable_web_page_preview,
)

async def forwardMessage(
self, chat_id, from_chat_id, message_id, disable_notification=False
):
async def forwardMessage(self,
chat_id,
from_chat_id,
message_id,
disable_notification=False):
"""Foward a message.

Parameters
@@ -320,7 +318,10 @@ async def setChatPhoto(self, chat_id, photo):
The photo you want to use."""
return await self.send("setChatPhoto", chat_id=chat_id, photo=photo)

async def pinChatMessage(self, chat_id, message_id, disable_notification=False):
async def pinChatMessage(self,
chat_id,
message_id,
disable_notification=False):
"""Pin a message.

Parameters
@@ -347,9 +348,9 @@ async def unpinChatMessage(self, chat_id, message_id):
The chat id you want to unpin the message.
message_id: `int`
The message id you want to unpin."""
return await self.send(
"unpinChatMessage", chat_id=chat_id, message_id=message_id
)
return await self.send("unpinChatMessage",
chat_id=chat_id,
message_id=message_id)

async def leaveChat(self, chat_id):
"""Leave a chat.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -7,7 +7,8 @@
version="0.3.2",
author="Hexye",
author_email="[email protected]",
description="An api wrapper for telegram easy to use. Coerent according to telegram core.",
description=
"An api wrapper for telegram easy to use. Coerent according to telegram core.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/HexyeDEV/EzTg/",