tuxbot-bot/tuxbot/cogs/Admin/models/alias.py

24 lines
578 B
Python

import tortoise
from tortoise import fields
class Alias(tortoise.Model):
id = fields.BigIntField(pk=True)
user_id = fields.BigIntField()
alias = fields.TextField(max_length=255)
command = fields.TextField(max_length=255)
guild = fields.BigIntField()
class Meta:
table = "aliases"
def __str__(self):
return (
f"<Alias id={self.id} "
f"user_id={self.user_id} "
f"alias='{self.alias}' "
f"command='{self.command}' "
f"guild={self.guild}>"
)
__repr__ = __str__