Skip to main content

Aiogra3 Triggers

Project description

aiogram3-triggers

Aiogram3 Triggers

#  *-+-+-+-+ +-+-+ +-+-+-+-+-+-+-+-+-+-* #
#  |S|o|f|t| |b|y| |@|z|c|x|w|_|l|o|l|z| #
#  *-+-+-+-+ +-+-+ +-+-+-+-+-+-+-+-+-+-* #


from aiogram import Bot, Dispatcher, F, Router, types

# Import aiogram3 triggers
from aiogram3_triggers import TRouter

API_TOKEN = 'Bot Secret'


# Initialize bot and dispatcher
bot = Bot(token=API_TOKEN)


dp = Dispatcher()

# create routers

router = Router()

# create aiogram3 triggers router
trouter = TRouter()


@trouter.triggers_handler(1)
async def trigger_print(dispatcher: Dispatcher, bot: Bot):
    print("Trigger on")


@router.message(F.text == 'hello')
async def send_hello(message: types.Message):
    await message.reply("Hi!\nI'm Triggers Bot!\nPowered by zcxw.")

if __name__ == '__main__':
    dp.include_routers(router, trouter)
    dp.run_polling(bot)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiogram3_triggers-0.0.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

aiogram3_triggers-0.0.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file aiogram3_triggers-0.0.0.tar.gz.

File metadata

  • Download URL: aiogram3_triggers-0.0.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for aiogram3_triggers-0.0.0.tar.gz
Algorithm Hash digest
SHA256 b2589cbec273d75a8825922f0072c182a52aa8b0bfa13d117bec1251ac4d0294
MD5 be1c518e4b0a5bb8ce552897941a41ca
BLAKE2b-256 1f73b154692364174f3bf2c22166e736c2d12a9f8291e89a535a105ddc56cbef

See more details on using hashes here.

File details

Details for the file aiogram3_triggers-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aiogram3_triggers-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bef6d5ddc500e80027afe1b18109a4daf41a2b12b61e4ff1f82f7242d2e6daf4
MD5 bd618db6a2d0d4e8a0bb0a7b56d6426f
BLAKE2b-256 1ee9dbb8bac6d76c544b4a90cd69599decfdea0aef121c31afb555c725fa0ccd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page