Pyrofork: types: giveaway: Add FloodWait Exception handling

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2023-11-26 02:01:27 +07:00
parent 0943ac72bd
commit 8e5e317ed1
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -16,10 +16,12 @@
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>. # along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
import asyncio
import pyrogram import pyrogram
from datetime import datetime from datetime import datetime
from pyrogram import raw, types, utils from pyrogram import raw, types, utils
from pyrogram.errors import FloodWait
from ..object import Object from ..object import Object
from typing import List from typing import List
@ -85,6 +87,8 @@ class Giveaway(Object):
id=[await client.resolve_peer(channel_id)] id=[await client.resolve_peer(channel_id)]
) )
) )
except FloodWait as e:
await asyncio.sleep(e.value)
except Exception: except Exception:
private_ids.append(channel_id) private_ids.append(channel_id)
else: else: