See my Valorant's statistic here
Image above was generated by this magic code.
I'm Kiizuha Kanazawa (23 y.o)! I live in Tangerang, Indonesia. ๐
I'd love to create project that has relation to games or anything I like now.
A useful filter that can set your user into cooldown with a specific command you choose with a decorator (@).
License: MIT License
See my Valorant's statistic here
Image above was generated by this magic code.
I'm Kiizuha Kanazawa (23 y.o)! I live in Tangerang, Indonesia. ๐
I'd love to create project that has relation to games or anything I like now.
if msg.date >= data[user_id]['timestamp'] + flt.data:
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'datetime.datetime' and 'int'
can be fixed by
if msg.date >= data[user_id]['timestamp'] + timedelta(seconds=flt.data):
on line 24 on cooldown.py
and on line 3
from datetime import datetime, timedelta
and you can change the task function to this for nice animation
async def task(msg, warn = False, sec = None):
if warn:
user = msg.from_user
ids = await msg.reply(f"Sorry {user.mention}, you're in cooldown now, wait for `{sec}`s to use command again..")
for i in range(sec):
await ids.edit(f"Sorry {user.mention}, you're in cooldown now, wait for `{sec-(i+1)}`s to use command again..")
await asyncio.sleep(1)
await ids.edit(f"Alright {user.mention}, your cooldown is over you can command again.")
await asyncio.sleep(3)
await ids.delete()
I got this error while running the examples
Pyrogram v1.2.9, Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
Licensed under the terms of the GNU Lesser General Public License v3 or later (LGPLv3+)
Traceback (most recent call last):
File "run.py", line 19, in <module>
bot.start()
File "/usr/local/lib/python3.8/dist-packages/pyrogram/sync.py", line 56, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/usr/local/lib/python3.8/dist-packages/pyrogram/methods/utilities/start.py", line 68, in start
await self.initialize()
File "/usr/local/lib/python3.8/dist-packages/pyrogram/methods/auth/initialize.py", line 44, in initialize
self.load_plugins()
File "/usr/local/lib/python3.8/dist-packages/pyrogram/client.py", line 736, in load_plugins
module = import_module(module_path)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/aziz/pyrogram-cooldown/plugins/echo.py", line 6, in <module>
@bot.on_message(filters.command(['test']) & cooldown.wait(5))
File "/home/aziz/pyrogram-cooldown/plugins/utils/cooldown.py", line 36, in wait
return filters.create(___, data=sec)
NameError: name 'filters' is not defined
It's can be fixed by importing pyrogram.filters on cooldown.py
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.