forked from RaphielGang/Telegram-Paperplane
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Releasing 2.1, also has fixes for known issues, and gspider also added
Signed-off-by: baalajmaestro <[email protected]>
- Loading branch information
1 parent
e77e415
commit f2d3f2b
Showing
9 changed files
with
106 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
try: | ||
from userbot.modules.sql_helper import SESSION, BASE | ||
except ImportError: | ||
raise Exception("Hello!") | ||
|
||
from sqlalchemy import Column, String, UnicodeText, Boolean, Integer, distinct, func | ||
|
||
|
||
class GMute(BASE): | ||
__tablename__ = "gmute" | ||
sender = Column(String(14), primary_key=True) | ||
|
||
def __init__(self, sender): | ||
self.sender = str(sender) | ||
|
||
|
||
GMute.__table__.create(checkfirst=True) | ||
|
||
|
||
def is_gmuted(sender_id): | ||
try: | ||
return SESSION.query(GMute).all() | ||
except: | ||
return None | ||
finally: | ||
SESSION.close() | ||
|
||
|
||
def gmute(sender): | ||
adder = GMute(str(sender)) | ||
SESSION.add(adder) | ||
SESSION.commit() | ||
|
||
|
||
def ungmute(sender): | ||
rem = SESSION.query(GMute).get((str(sender))) | ||
if rem: | ||
SESSION.delete(rem) | ||
SESSION.commit() |