Skip to content

Instantly share code, notes, and snippets.

View MasterGroosha's full-sized avatar

Aleksandr MasterGroosha

View GitHub Profile
@MasterGroosha
MasterGroosha / aiogram_cli.py
Created November 14, 2020 23:00
The simpliest CLI for aiogram
import asyncio
import shlex
from aiogram import Bot
from json import loads, dumps
# Suppress DeprecationWarning from close() method
import logging
logging.captureWarnings(True)
@MasterGroosha
MasterGroosha / bot.py
Created November 25, 2020 11:09
aiogram custom filter example
import logging
from aiogram import Bot, Dispatcher, executor, types
from aiogram.dispatcher.filters import Filter
logging.basicConfig(level=logging.INFO)
bot = Bot(token="")
dp = Dispatcher(bot)
admins = set()
@MasterGroosha
MasterGroosha / index.html
Created April 16, 2021 13:42
Vue rendering: preventing unnecesary re-rendering by passing objects
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</script>
</head>
<body>
<div id="app">
</div>
</body>
@MasterGroosha
MasterGroosha / bot.py
Last active January 8, 2023 07:06
Set only needed updates (aiogram 2.20+)
import asyncio
import logging
from aiogram import Bot, Dispatcher
from aiogram.types import BotCommand
from bot.config_reader import load_config
from bot.middlewares.config import ConfigMiddleware
from bot.handlers.main_group_events import register_group_events
from bot.handlers.callbacks_reports import register_callbacks_reports