mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Pyrofork: types: giveaway: Add FloodWait Exception handling
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
0943ac72bd
commit
8e5e317ed1
1 changed files with 4 additions and 0 deletions
|
|
@ -16,10 +16,12 @@
|
|||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import asyncio
|
||||
import pyrogram
|
||||
|
||||
from datetime import datetime
|
||||
from pyrogram import raw, types, utils
|
||||
from pyrogram.errors import FloodWait
|
||||
from ..object import Object
|
||||
from typing import List
|
||||
|
||||
|
|
@ -85,6 +87,8 @@ class Giveaway(Object):
|
|||
id=[await client.resolve_peer(channel_id)]
|
||||
)
|
||||
)
|
||||
except FloodWait as e:
|
||||
await asyncio.sleep(e.value)
|
||||
except Exception:
|
||||
private_ids.append(channel_id)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue