aiogram / bot Goto Github PK
View Code? Open in Web Editor NEWThis bot is used as example of usage aiogram framework and as admin-helper in our community chats.
Home Page: https://t.me/aiogram_bot
License: MIT License
This bot is used as example of usage aiogram framework and as admin-helper in our community chats.
Home Page: https://t.me/aiogram_bot
License: MIT License
This may help to prevent a wall of "xxx joined the group" messages, so only approved members are seen.
Currently when a channel is banned, it's username is posted with leading @, making it clickable, which helps promoting such channels.
I suggest removing the @ symbol so chat user won't be able to open that channel instantly.
Later another rule can be applied which replaces some symbols in usernames with asterisks (*)
Using entrypoint causes docker to spawn another process to execute python, and it doesn't receive stop signals. This leaves on_shutdown events unexecuted.
Line 9 in 5d892a2
In the first lines of the function above, you check the user_id is existed by calling get_args
method of the message. The check always returns false.
The method message.get_args()
returns an argument only if it command that starts with /
.
Trace:
message.get_args() -> message.get_full_command() -> message.is_command() -> return self.text and self.text.startswith("/")
Handled this exception when user click /start
in private chat with bot.
How is possible?
2019-10-20 18:27:03.410 | INFO | aiogram.contrib.middlewares.logging:on_post_process_update:34 - Process update [ID:773110463]: [success] (in 8 ms)
└ <click.core.Group object at 0x7f1ddfeb17d0>
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
│ │ │ │ └ <click.core.Context object at 0x7f1de2ac7c10>
│ │ │ └ <function Command.invoke at 0x7f1de2a03f80>
│ │ └ <click.core.Command object at 0x7f1ddfd31e90>
│ └ <click.core.Context object at 0x7f1de2ac7c10>
└ <function MultiCommand.invoke.<locals>._process_result at 0x7f1de2b72cb0>
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
│ │ │ │ │ └ {'skip_updates': False, 'autoreload': False}
│ │ │ │ └ <click.core.Context object at 0x7f1de2ac7c10>
│ │ │ └ <function polling at 0x7f1de10924d0>
│ │ └ <click.core.Command object at 0x7f1ddfd31e90>
│ └ <function Context.invoke at 0x7f1de2a03170>
└ <click.core.Context object at 0x7f1de2ac7c10>
File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
│ │ └ {'skip_updates': False, 'autoreload': False}
│ └ ()
└ <function polling at 0x7f1de10924d0>
File "/app/app/utils/cli.py", line 51, in polling
runner.start_polling(reset_webhook=True)
│ └ <function Executor.start_polling at 0x7f1de060add0>
└ <aiogram.utils.executor.Executor object at 0x7f1ddf4f0b90>
File "/usr/local/lib/python3.7/site-packages/aiogram/utils/executor.py", line 308, in start_polling
loop.run_forever()
│ └ <method 'run_forever' of 'uvloop.loop.Loop' objects>
└ <uvloop.Loop running=True closed=False debug=False>
File "/usr/local/lib/python3.7/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
│ │ │ └ {}
│ │ └ (<aiogram.types.update.Update object at 0x7f1ddc872d10>,)
│ └ <bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f1de147f050>>
└ Handler.HandlerObj(handler=<bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7...
File "/usr/local/lib/python3.7/site-packages/aiogram/dispatcher/dispatcher.py", line 223, in process_update
err = await self.errors_handlers.notify(update, e)
│ │ │ │ └ TypeError("'datetime.time' object is not iterable")
│ │ │ └ <aiogram.types.update.Update object at 0x7f1ddc872d10>
│ │ └ <function Handler.notify at 0x7f1de05e4440>
│ └ <aiogram.dispatcher.handler.Handler object at 0x7f1de147f390>
└ <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f1de147f050>
File "/usr/local/lib/python3.7/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
│ │ │ └ {}
│ │ └ (<aiogram.types.update.Update object at 0x7f1ddc872d10>, TypeError("'datetime.time' object is not iterable"))
│ └ <function errors_handler at 0x7f1de14920e0>
└ Handler.HandlerObj(handler=<function errors_handler at 0x7f1de14920e0>, spec=FullArgSpec(args=['update', 'exception'], vararg...
> File "/app/app/handlers/base.py", line 27, in errors_handler
raise exception
└ TypeError("'datetime.time' object is not iterable")
File "/usr/local/lib/python3.7/site-packages/aiogram/dispatcher/dispatcher.py", line 192, in process_update
return await self.message_handlers.notify(update.message)
│ │ │ │ └ <aiogram.types.fields.Field object at 0x7f1de054b810>
│ │ │ └ <aiogram.types.update.Update object at 0x7f1ddc872d10>
│ │ └ <function Handler.notify at 0x7f1de05e4440>
│ └ <aiogram.dispatcher.handler.Handler object at 0x7f1de147f110>
└ <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f1de147f050>
File "/usr/local/lib/python3.7/site-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
│ │ │ └ {'user': <app.models.user.User object at 0x7f1ddc872710>}
│ │ └ (<aiogram.types.message.Message object at 0x7f1ddc872cd0>,)
│ └ <function cmd_start at 0x7f1de1492050>
└ Handler.HandlerObj(handler=<function cmd_start at 0x7f1de1492050>, spec=FullArgSpec(args=['message', 'user'], varargs=None, v...
File "/app/app/handlers/base.py", line 16, in cmd_start
user=md.quote_html(message.from_user.full_name),
│ │ │ │ └ <aiogram.types.fields.Field object at 0x7f1de05e83d0>
│ │ │ └ <aiogram.types.message.Message object at 0x7f1ddc872cd0>
│ │ └ <function quote_html at 0x7f1ddfe3a5f0>
│ └ <module 'aiogram.utils.markdown' from '/usr/local/lib/python3.7/site-packages/aiogram/utils/markdown.py'>
└ <app.models.user.User object at 0x7f1ddc872710>
File "/usr/local/lib/python3.7/site-packages/aiogram/utils/markdown.py", line 51, in quote_html
for symbol in content:
└ datetime.time(21, 59, 17, tzinfo=datetime.timezone.utc)
TypeError: 'datetime.time' object is not iterable
https://github.com/aiogram/bot#how-this-bot-is-deployed-now
here we have the wrong link
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.