Skip to content

can't we register two handlers like @client.event(MessageEv) ? #159

@NandhaxD

Description

@NandhaxD

hello there! i was trying to register two @client.event(MessageEv)

my code was look like:

import config
import strings

from nandha import client, log
from neonize.client import NewClient
from nandha.utils import command
from neonize.events import MessageEv, ConnectedEv, event


@client.event(MessageEv)
@command('help')
def on_help(client: NewClient, event: MessageEv):
    try:
        cmds_text = '*Here My List Of Commands:*\n\n'
        for cmd in config.all_cmds:
            cmds_text += f'- {cmd}\n'

        client.reply_message(cmds_text, event)
    except Exception as e:
        log.error(f"Failed to send help message: {e}")




@client.event(MessageEv)
@command('start')
def on_start(client: NewClient, event: MessageEv):
    try:
        client.reply_message('start text', event)
    except Exception as e:
        log.error(f"Failed to send start message: {e}")

on_help does not work, but on_start func work. are we can only register one ???

please reply in my telegram i am not active i'm curious with this project thank you (:
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions