mirror of
https://github.com/solero/houdini.git
synced 2024-11-10 05:08:19 +00:00
Penguin add_stamp method
This commit is contained in:
parent
394b98d2fe
commit
e0a834ccbd
@ -172,6 +172,20 @@ class Penguin(Spheniscidae):
|
||||
|
||||
return True
|
||||
|
||||
async def add_stamp(self, stamp, notify=True):
|
||||
if stamp.id in self.data.stamps:
|
||||
return False
|
||||
|
||||
await self.data.stamps.set(stamp.id)
|
||||
|
||||
if notify:
|
||||
await self.send_xt('aabs', stamp.id)
|
||||
|
||||
self.logger.info('{} earned stamp \'{}\''.format(self.data.username, stamp.name))
|
||||
await self.server.cache.delete('stamps.{}'.format(self.data.id))
|
||||
|
||||
return True
|
||||
|
||||
async def add_inbox(self, postcard, sender_name="sys", sender_id=None, details=""):
|
||||
penguin_postcard = await self.data.postcards.set(penguin_id=self.data.id,
|
||||
sender_id=sender_id, postcard_id=postcard.id,
|
||||
|
Loading…
Reference in New Issue
Block a user