this is a failure :'(
This commit is contained in:
parent
89120454ad
commit
b39031d53d
2 changed files with 64 additions and 0 deletions
|
@ -144,6 +144,62 @@ class Client(Aobject):
|
||||||
}
|
}
|
||||||
await self.__send_message(room, msg)
|
await self.__send_message(room, msg)
|
||||||
|
|
||||||
|
async def send_firework_message(
|
||||||
|
self,
|
||||||
|
room: Union[RoomAlias, RoomId],
|
||||||
|
message: str,
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
Send message with the firework effect.
|
||||||
|
"""
|
||||||
|
msg = {
|
||||||
|
"body": message,
|
||||||
|
"msgtype": "nic.custom.fireworks"
|
||||||
|
}
|
||||||
|
await self.__send_message(room, msg)
|
||||||
|
|
||||||
|
async def send_confetti_message(
|
||||||
|
self,
|
||||||
|
room: Union[RoomAlias, RoomId],
|
||||||
|
message: str,
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
Send message with the confetti effect.
|
||||||
|
"""
|
||||||
|
msg = {
|
||||||
|
"body": message,
|
||||||
|
"msgtype": "nic.custom.confetti"
|
||||||
|
}
|
||||||
|
await self.__send_message(room, msg)
|
||||||
|
|
||||||
|
async def send_snow_message(
|
||||||
|
self,
|
||||||
|
room: Union[RoomAlias, RoomId],
|
||||||
|
message: str,
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
Send message with the snowfall effect.
|
||||||
|
"""
|
||||||
|
msg = {
|
||||||
|
"body": message,
|
||||||
|
"msgtype": "io.element.effect.snowfall"
|
||||||
|
}
|
||||||
|
await self.__send_message(room, msg)
|
||||||
|
|
||||||
|
async def send_space_invader_message(
|
||||||
|
self,
|
||||||
|
room: Union[RoomAlias, RoomId],
|
||||||
|
message: str,
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
Send message with the space invader effect.
|
||||||
|
"""
|
||||||
|
msg = {
|
||||||
|
"body": message,
|
||||||
|
"msgtype": "io.element.effects.space_invaders"
|
||||||
|
}
|
||||||
|
await self.__send_message(room, msg)
|
||||||
|
|
||||||
async def __save_sync_tocken(self)->NoReturn:
|
async def __save_sync_tocken(self)->NoReturn:
|
||||||
"""
|
"""
|
||||||
Save the sync token.
|
Save the sync token.
|
||||||
|
|
|
@ -28,6 +28,14 @@ async def main():
|
||||||
room_name = withelisted_room_names[0]
|
room_name = withelisted_room_names[0]
|
||||||
client.set_invite_policy(whitelist_policy)
|
client.set_invite_policy(whitelist_policy)
|
||||||
await client.send_message(room_name, "Beware of Greeks bearing gifts")
|
await client.send_message(room_name, "Beware of Greeks bearing gifts")
|
||||||
|
await asyncio.sleep(5)
|
||||||
|
await client.send_firework_message(room_name, "fire")
|
||||||
|
await asyncio.sleep(5)
|
||||||
|
await client.send_confetti_message(room_name, "confetti")
|
||||||
|
await asyncio.sleep(5)
|
||||||
|
await client.send_snow_message(room_name, "snow")
|
||||||
|
await asyncio.sleep(5)
|
||||||
|
await client.send_space_invader_message(room_name, "space")
|
||||||
await client.run()
|
await client.run()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue