Vexed01 / Vex-Cogs

My cogs for Red.
https://cogdocs.vexcodes.com
GNU General Public License v3.0
27 stars 20 forks source link

[Birthday] Message post failed with traceback #92

Closed Clasko closed 2 years ago

Clasko commented 2 years ago

What cog is this bug report for?

Birthday

What versions are you running?

Versions                      
                ╷         ╷         ╷              
                │ Current │ Latest  │ Up to date?  
╶───────────────┼─────────┼─────────┼─────────────╴
  This Cog      │ 1.0.11  │ 1.0.10  │ 🟢           
  Bundled Utils │ b9bfa44 │ b9bfa44 │ 🟢           
  Red           │ 3.4.16  │ 3.4.16  │ 🟢           
                ╵         ╵         ╵

Describe the bug

The bot didn't post a message on birthday but role assignment worked.

If there's an error, paste it here

[11:00:27] ERROR    [red.vex.birthday.loop] Something went wrong in the Birthday loop. The loop will try again in an hour. Please report this and the below information to Vexed.
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /app/docker/cogs/CogManager/cogs/birthday/loop.py:118 in birthday_loop       │
│ ❱ 118                 await self._update_birthdays()                         │
│ /app/docker/cogs/CogManager/cogs/birthday/loop.py:207 in _update_birthdays   │
│ ❱ 207                             format_bday_message(all_settings[guild.id] │
│       ], member),                                                            │
│ /app/docker/cogs/CogManager/cogs/birthday/utils.py:26 in format_bday_message │
│ ❱ 26         return message.format(mention=author.mention, name=author.displ │
╰──────────────────────────────────────────────────────────────────────────────╯
KeyError: 'new_age'
Vexed01 commented 2 years ago

You've incorrectly configured the message without a year to include the {new_age} variable. If the year isn't known that varibale can't be used. I will add checking to make sure this doesn't error so badly, but for now you can do [p]bdset msgwithoutyear and only include {mention} and {name}.

I'll leave the issue open until I've fixed things on the code side to prevent this.

Clasko commented 2 years ago

Argh, you're right... copy&paste mistake. Thank you for your quick response! :)

Vexed01 commented 2 years ago

It will now be impossible to set a message which would cause that error from Birthday 1.0.12, thanks again for letting me know in the first place.