This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print( | |
self, | |
*objects: Any, | |
sep: str = " ", | |
end: str = "\n", | |
style: Optional[Union[str, Style]] = None, | |
justify: Optional[JustifyMethod] = None, | |
overflow: Optional[OverflowMethod] = None, | |
no_wrap: Optional[bool] = None, | |
emoji: Optional[bool] = None, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin | |
from django.db import models | |
from django.utils.translation import ugettext_lazy as _ | |
from .managers import UserManager | |
class User(AbstractBaseUser, PermissionsMixin): | |
""" | |
User model, extends `django.contrib.auth.models.AbstractBaseUser` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def admin_only(func): | |
def check_permissions(*args, **kwargs): | |
bot = args[0] | |
update = args[1] | |
admin_ids = list(Player.objects.filter(gm=True).values_list('telegram_id', flat=True)) | |
current_user = update.message.from_user | |
if current_user.id not in admin_ids: | |
update.message.reply_text("You are not allowed to do this, Troubleshooter. This incident will be reported") | |
message = "The user {} just entered a forbidden command.".format(current_user) | |
log_channel_id = Game.objects.get(pk=1).channel_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef dnf | |
# Main dispatcher | |
_dnf() | |
{ | |
local curcontext="$curcontext" state lstate line | |
_arguments -s \ | |
'(- *)'{-h,--help}'[show the help message]' \ | |
'(-t --tolerant)'{-t,--tolerant}'[be tolerant of errors]' \ |