Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change admin command checks to a decorator #28

Open
richteer opened this issue Jun 3, 2015 · 0 comments
Open

Change admin command checks to a decorator #28

richteer opened this issue Jun 3, 2015 · 0 comments

Comments

@richteer
Copy link
Contributor

richteer commented Jun 3, 2015

Was considering changing the typically same boilerplate of

def foo(self, msg):
    if self.xmpp.isadmin(msg['from']):
        pass
    else:
        self.xmpp.reply(msg, "Berating message goes here")
        return

to something a little prettier, like:

@admin
def foo(self, msg):
    pass

I think this may coincide with the proposed API change a bit better too, to make the module writing cleaner, and more concise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant