Browse Source

Adapt to changes in telegram's api

tags/v0.1.8
drymer 2 years ago
parent
commit
002df9336e
3 changed files with 14 additions and 4 deletions
  1. +9
    -2
      jabbergram.py
  2. +2
    -2
      requirements.txt
  3. +3
    -0
      seeIdGroups.py

+ 9
- 2
jabbergram.py View File

@@ -111,6 +111,10 @@ class Jabbergram(sleekxmpp.ClientXMPP):
name = ''
size = 0

if update.edited_message:
update_id = update.update_id + 1
continue

if update.message.from_user:
user = str(update.message.from_user.username)

@@ -176,7 +180,7 @@ class Jabbergram(sleekxmpp.ClientXMPP):
'but the XMPP server doesn\'t support H'\
'TTP Upload.'

elif update.message.new_chat_member:
elif update.message.new_chat_members:
message = 'This user has joined the group.'
elif update.message.left_chat_member:
message = 'This user has left the group.'
@@ -203,7 +207,10 @@ class Jabbergram(sleekxmpp.ClientXMPP):
else:
msg = user + ": " + message

chat = '@' + update.message.chat.username
if update.message.chat.type == 'supergroup':
chat = '@' + update.message.chat.username
else:
chat = str(update.message.chat.id)

if chat not in self.groups:
chat = str(update.message.chat_id)

+ 2
- 2
requirements.txt View File

@@ -1,3 +1,3 @@
sleekxmpp >= 1.3.1
python-telegram-bot >= 4.0.3
sleekxmpp >= 1.3.2
python-telegram-bot >= 6.1.0
requests >= 2.11.1

+ 3
- 0
seeIdGroups.py View File

@@ -30,6 +30,9 @@ printed = []
while True:
try:
for update in bot.getUpdates(offset=update_id, timeout=10):
if update.edited_message:
update_id = update.update_id + 1
continue
chat_id = update.message.chat_id
chat_title = update.message
if chat_id not in printed:

Loading…
Cancel
Save