diff --git a/sizebot/cogs/objects.py b/sizebot/cogs/objects.py index 8265a045..46db7271 100644 --- a/sizebot/cogs/objects.py +++ b/sizebot/cogs/objects.py @@ -316,7 +316,7 @@ async def food(self, ctx, food: typing.Union[DigiObject, str], *, who: typing.Un food_per_day = 1 / days_per_food if food_per_day >= 1: - foodout = f"{userdata.nickname} would need to eat **{food_per_day:,.1} {food.namePlural}** per day.\n(1 {food.name} is {food.calories} calories.)" + foodout = f"{userdata.nickname} would need to eat **{food_per_day:,.1} {food.name_plural}** per day.\n(1 {food.name} is {food.calories} calories.)" else: foodout = f"A {food.name} ({food.calories} calories) would last {userdata.nickname} **{prettyTimeDelta(86400 * days_per_food, roundeventually=True)}.**" diff --git a/sizebot/lib/objs.py b/sizebot/lib/objs.py index c4d513df..439e85a6 100644 --- a/sizebot/lib/objs.py +++ b/sizebot/lib/objs.py @@ -29,8 +29,8 @@ def __init__(self, name, dimension, aliases=[], tags=[], symbol = None, height = self.name = name self.dimension = dimension - self.namePlural = get_plural(name) - self.singularNames = aliases + [self.name] + self.name_plural = get_plural(name) + self.singular_names = aliases + [self.name] self.aliases = aliases + [get_plural(a) for a in aliases] self.aliases = self.aliases + [a.replace("™", "").replace("®", "") for a in self.aliases + [self.name]] # Remove ®, ™ self.aliases = list(set(self.aliases)) # Remove duplicates @@ -68,12 +68,12 @@ def image(self): def add_to_units(self): if self.unitlength is not None: - SV.addUnit(Unit(factor=self.unitlength, name=self.name, namePlural=self.namePlural, + SV.addUnit(Unit(factor=self.unitlength, name=self.name, namePlural=self.name_plural, names=self.aliases, symbol = self.symbol)) SV.addSystemUnit("o", SystemUnit(self.name)) if self.weight is not None: - WV.addUnit(Unit(factor=self.weight, name=self.name, namePlural=self.namePlural, + WV.addUnit(Unit(factor=self.weight, name=self.name, namePlural=self.name_plural, names=self.aliases, symbol = self.symbol)) WV.addSystemUnit("o", SystemUnit(self.name)) @@ -185,7 +185,7 @@ def __eq__(self, other): if isinstance(other, str): lowerName = other.lower() return lowerName == self.name.lower() \ - or lowerName == self.namePlural \ + or lowerName == self.name_plural \ or lowerName in (n.lower() for n in self.aliases) elif isinstance(other, DigiObject): return (self.name, self.unitlength) == (other.name, other.unitlength)