DryGram 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. drygram/__init__.py +173 -0
  2. drygram/bridge/__init__.py +7 -0
  3. drygram/bridge/adapter.py +53 -0
  4. drygram/bridge/client.py +24 -0
  5. drygram/client.py +2609 -0
  6. drygram/commands/__init__.py +100 -0
  7. drygram/commands/aliases.py +26 -0
  8. drygram/commands/analytics.py +44 -0
  9. drygram/commands/arguments.py +30 -0
  10. drygram/commands/autocomplete.py +25 -0
  11. drygram/commands/categories.py +13 -0
  12. drygram/commands/checks.py +21 -0
  13. drygram/commands/completion.py +19 -0
  14. drygram/commands/context.py +38 -0
  15. drygram/commands/converters.py +75 -0
  16. drygram/commands/cooldown.py +41 -0
  17. drygram/commands/decorators.py +63 -0
  18. drygram/commands/executor.py +78 -0
  19. drygram/commands/formatter.py +304 -0
  20. drygram/commands/groups.py +22 -0
  21. drygram/commands/help.py +56 -0
  22. drygram/commands/history.py +49 -0
  23. drygram/commands/matcher.py +40 -0
  24. drygram/commands/parser.py +48 -0
  25. drygram/commands/permissions.py +63 -0
  26. drygram/commands/prefixes.py +51 -0
  27. drygram/commands/registry.py +89 -0
  28. drygram/commands/router.py +134 -0
  29. drygram/commands/syntax.py +25 -0
  30. drygram/commands/validator.py +5 -0
  31. drygram/commands/validators.py +31 -0
  32. drygram/compat.py +395 -0
  33. drygram/crypto/cipher.py +126 -0
  34. drygram/dispatch/dispatcher.py +137 -0
  35. drygram/dispatch/gate.py +584 -0
  36. drygram/dispatch/pipeline.py +44 -0
  37. drygram/dispatch/queue.py +51 -0
  38. drygram/dispatch/scheduler.py +146 -0
  39. drygram/dispatch/watcher.py +68 -0
  40. drygram/errors/rpc.py +548 -0
  41. drygram/network/connection.py +56 -0
  42. drygram/network/core.py +91 -0
  43. drygram/network/pool.py +175 -0
  44. drygram/network/proxy.py +113 -0
  45. drygram/network/transport.py +233 -0
  46. drygram/parsers/html.py +80 -0
  47. drygram/parsers/markdown.py +81 -0
  48. drygram/plugins/loader.py +131 -0
  49. drygram/raw/__init__.py +26 -0
  50. drygram/raw/functions.py +58 -0
  51. drygram/raw/parser.py +252 -0
  52. drygram/raw/types.py +81 -0
  53. drygram/sessions/__init__.py +28 -0
  54. drygram/sessions/base.py +52 -0
  55. drygram/sessions/binary.py +66 -0
  56. drygram/sessions/custom.py +43 -0
  57. drygram/sessions/encrypted.py +107 -0
  58. drygram/sessions/json.py +121 -0
  59. drygram/sessions/memory.py +22 -0
  60. drygram/sessions/mongo.py +87 -0
  61. drygram/sessions/postgres.py +102 -0
  62. drygram/sessions/redis.py +82 -0
  63. drygram/sessions/session.py +527 -0
  64. drygram/sessions/sqlite.py +187 -0
  65. drygram/types/base.py +8 -0
  66. drygram/types/business.py +34 -0
  67. drygram/types/chat.py +104 -0
  68. drygram/types/emoji.py +172 -0
  69. drygram/types/markup.py +101 -0
  70. drygram/types/media.py +103 -0
  71. drygram/types/message.py +87 -0
  72. drygram/types/premium.py +40 -0
  73. drygram/types/story.py +30 -0
  74. drygram/version.py +155 -0
  75. drygram-1.0.0.dist-info/METADATA +257 -0
  76. drygram-1.0.0.dist-info/RECORD +81 -0
  77. drygram-1.0.0.dist-info/WHEEL +5 -0
  78. drygram-1.0.0.dist-info/licenses/COPYING +624 -0
  79. drygram-1.0.0.dist-info/licenses/LICENSE +19 -0
  80. drygram-1.0.0.dist-info/licenses/NOTICE +6 -0
  81. drygram-1.0.0.dist-info/top_level.txt +1 -0
drygram/__init__.py ADDED
@@ -0,0 +1,173 @@
1
+ # DryGram Developed By Santhu
2
+ # mail: telegramsanthu@gmail.com
3
+ from drygram.client import DryClient
4
+ from drygram.bridge import BridgeClient, BridgeAdapter
5
+ from drygram.sessions.base import BaseSession
6
+ from drygram.sessions.session import Session
7
+ from drygram.sessions.memory import MemorySession
8
+ from drygram.sessions.sqlite import SQLiteSession
9
+ from drygram.sessions.binary import BinarySession
10
+ from drygram.sessions.encrypted import EncryptedSession
11
+ from drygram.sessions.json import JSONSession
12
+ from drygram.sessions.custom import CustomSession
13
+ from drygram.sessions.postgres import PostgresSession
14
+ from drygram.sessions.redis import RedisSession
15
+ from drygram.sessions.mongo import MongoSession
16
+ from drygram.dispatch.gate import Gate, Gates
17
+ from drygram.dispatch.watcher import Watcher
18
+ from drygram.dispatch.scheduler import TaskScheduler, ScheduledTask
19
+ from drygram.types.chat import User, Chat, Topic, Folder
20
+ from drygram.types.message import Message, MessageEffect, CloudDraft
21
+ from drygram.types.media import Photo, Video, Document, Audio, VoiceNote, VideoNote, Location, LiveLocation, WebApp, MiniApp, Poll, Quiz, MediaGroup, PollOption
22
+ from drygram.types.markup import KeyboardButton, InlineKeyboardButton, ReplyKeyboardMarkup, InlineKeyboardMarkup
23
+ from drygram.types.story import Story, StoryReaction, StoryPrivacy, StoryArchive
24
+ from drygram.types.business import BusinessConnection, BusinessLink, BusinessGreeting, BusinessAway, BusinessReply
25
+ from drygram.types.premium import StarPayment, Gift, GiftUpgrade, Collectible, PremiumEmojiStatus
26
+ from drygram.types.emoji import Emoji, EmojiCategory, EmojiLookup, EmojiParser, EmojiFormatter, EmojiDatabase
27
+ from drygram.errors.rpc import (
28
+ DryError, RPCError, FloodWait, SessionError, NetworkError, AuthError,
29
+ SlowModeWait, PhoneMigrate, UserMigrate, FileMigrate, BadRequest,
30
+ Unauthorized, Forbidden, NotFound, NotAcceptable, Flood,
31
+ InternalServerError, RetryAfter, UnknownRPCError, from_rpc_error
32
+ )
33
+ from drygram.parsers.markdown import MarkdownParser
34
+ from drygram.parsers.html import HTMLParser
35
+ from drygram.version import VERSION
36
+ from drygram.compat import (
37
+ SessionManager, MediaUploader, MediaDownloader, BusinessManager,
38
+ StoryManager, PremiumManager, StickerManager, EmojiManager,
39
+ GiftManager, StarsManager, VoiceCallManager, VideoCallManager,
40
+ Router, Signal, Channel, Group, KeyboardBuilder, Button,
41
+ InlineKeyboard, ReplyKeyboard, CallbackButton, Logger, Cache, Storage,
42
+ SignalListener, MediaListener, BusinessListener, StoryListener,
43
+ VoiceListener, VideoListener, CallbackListener, InlineListener,
44
+ TopicListener, SchedulerListener, PluginListener, ConnectionListener,
45
+ UpdateListener
46
+ )
47
+
48
+ __all__ = [
49
+ "VERSION",
50
+ "DryClient",
51
+ "BridgeClient",
52
+ "BridgeAdapter",
53
+ "BaseSession",
54
+ "Session",
55
+ "MemorySession",
56
+ "SQLiteSession",
57
+ "BinarySession",
58
+ "EncryptedSession",
59
+ "JSONSession",
60
+ "CustomSession",
61
+ "PostgresSession",
62
+ "RedisSession",
63
+ "MongoSession",
64
+ "Gate",
65
+ "Gates",
66
+ "Watcher",
67
+ "TaskScheduler",
68
+ "ScheduledTask",
69
+ "User",
70
+ "Chat",
71
+ "Topic",
72
+ "Folder",
73
+ "Message",
74
+ "MessageEffect",
75
+ "CloudDraft",
76
+ "Photo",
77
+ "Video",
78
+ "Document",
79
+ "Audio",
80
+ "VoiceNote",
81
+ "VideoNote",
82
+ "Location",
83
+ "LiveLocation",
84
+ "WebApp",
85
+ "MiniApp",
86
+ "Poll",
87
+ "PollOption",
88
+ "Quiz",
89
+ "MediaGroup",
90
+ "KeyboardButton",
91
+ "InlineKeyboardButton",
92
+ "ReplyKeyboardMarkup",
93
+ "InlineKeyboardMarkup",
94
+ "Story",
95
+ "StoryReaction",
96
+ "StoryPrivacy",
97
+ "StoryArchive",
98
+ "BusinessConnection",
99
+ "BusinessLink",
100
+ "BusinessGreeting",
101
+ "BusinessAway",
102
+ "BusinessReply",
103
+ "StarPayment",
104
+ "Gift",
105
+ "GiftUpgrade",
106
+ "Collectible",
107
+ "PremiumEmojiStatus",
108
+ "Emoji",
109
+ "EmojiCategory",
110
+ "EmojiLookup",
111
+ "EmojiParser",
112
+ "EmojiFormatter",
113
+ "EmojiDatabase",
114
+ "DryError",
115
+ "RPCError",
116
+ "FloodWait",
117
+ "SlowModeWait",
118
+ "PhoneMigrate",
119
+ "UserMigrate",
120
+ "FileMigrate",
121
+ "BadRequest",
122
+ "Unauthorized",
123
+ "Forbidden",
124
+ "NotFound",
125
+ "NotAcceptable",
126
+ "Flood",
127
+ "InternalServerError",
128
+ "RetryAfter",
129
+ "UnknownRPCError",
130
+ "from_rpc_error",
131
+ "SessionError",
132
+ "NetworkError",
133
+ "AuthError",
134
+ "MarkdownParser",
135
+ "HTMLParser",
136
+ "SessionManager",
137
+ "MediaUploader",
138
+ "MediaDownloader",
139
+ "BusinessManager",
140
+ "StoryManager",
141
+ "PremiumManager",
142
+ "StickerManager",
143
+ "EmojiManager",
144
+ "GiftManager",
145
+ "StarsManager",
146
+ "VoiceCallManager",
147
+ "VideoCallManager",
148
+ "Router",
149
+ "Signal",
150
+ "Channel",
151
+ "Group",
152
+ "KeyboardBuilder",
153
+ "Button",
154
+ "InlineKeyboard",
155
+ "ReplyKeyboard",
156
+ "CallbackButton",
157
+ "Logger",
158
+ "Cache",
159
+ "Storage",
160
+ "SignalListener",
161
+ "MediaListener",
162
+ "BusinessListener",
163
+ "StoryListener",
164
+ "VoiceListener",
165
+ "VideoListener",
166
+ "CallbackListener",
167
+ "InlineListener",
168
+ "TopicListener",
169
+ "SchedulerListener",
170
+ "PluginListener",
171
+ "ConnectionListener",
172
+ "UpdateListener"
173
+ ]
@@ -0,0 +1,7 @@
1
+ # DryGram Developed By Santhu
2
+ # mail: telegramsanthu@gmail.com
3
+
4
+ from drygram.bridge.client import BridgeClient
5
+ from drygram.bridge.adapter import BridgeAdapter
6
+
7
+ __all__ = ["BridgeClient", "BridgeAdapter"]
@@ -0,0 +1,53 @@
1
+ # DryGram Developed By Santhu
2
+ # mail: telegramsanthu@gmail.com
3
+
4
+ from typing import Any
5
+ from drygram.bridge.client import BridgeClient
6
+
7
+ class BridgeAdapter:
8
+ """
9
+ Adapter class assisting external voice libraries in interfacing with DryClient/BridgeClient.
10
+ """
11
+ def __init__(self, client: BridgeClient):
12
+ self.client = client
13
+
14
+ @property
15
+ def mtproto(self):
16
+ """Access the underlying MTProto engine."""
17
+ return self.client.mtproto
18
+
19
+ @property
20
+ def session(self):
21
+ """Access the current session instance."""
22
+ return self.client.session
23
+
24
+ @property
25
+ def loop(self):
26
+ """Access the asyncio event loop."""
27
+ return self.client.loop
28
+
29
+ @property
30
+ def dispatcher(self):
31
+ """Access the update dispatcher."""
32
+ return self.client.dispatcher
33
+
34
+ @property
35
+ def network(self):
36
+ """Access the network layer."""
37
+ return self.client.network
38
+
39
+ async def invoke(self, query: Any) -> Any:
40
+ """Send a raw MTProto TL request."""
41
+ return await self.client.invoke(query)
42
+
43
+ async def export_session(self) -> str:
44
+ """Export the active session as a serialized string."""
45
+ return await self.client.export_session()
46
+
47
+ async def reconnect(self) -> None:
48
+ """Helper to trigger network reconnection."""
49
+ await self.client.reconnect()
50
+
51
+ async def synchronize_updates(self) -> None:
52
+ """Helper to synchronize update streams."""
53
+ await self.client.synchronize_updates()
@@ -0,0 +1,24 @@
1
+ # DryGram Developed By Santhu
2
+ # mail: telegramsanthu@gmail.com
3
+
4
+ import asyncio
5
+ from typing import Any, Optional, Union
6
+ from drygram.client import DryClient
7
+
8
+ class BridgeClient(DryClient):
9
+ """
10
+ Bridge client wrapping DryClient to provide compatibility for external voice libraries.
11
+ """
12
+ def __init__(self, *args, **kwargs):
13
+ super().__init__(*args, **kwargs)
14
+
15
+ async def reconnect(self) -> None:
16
+ """Helper to reconnect the client network pool."""
17
+ await self.restart()
18
+
19
+ async def synchronize_updates(self) -> None:
20
+ """Helper to synchronize update streams."""
21
+ if self.dispatcher:
22
+ # Re-starts the update processor pipeline
23
+ await self.dispatcher.stop()
24
+ await self.dispatcher.start()