mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +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
|
# 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:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue