Skip to content

Commit 5bd7c53

Browse files
committed
final docstrings
1 parent dda2679 commit 5bd7c53

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

nextgen_bot.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ async def on_connect(self, ctx: Context) -> None:
1111
async def on_message(self, ctx: Context) -> None:
1212
print(f"{ctx.user.name} sent '{ctx.message.message}'")
1313

14+
async def on_join(self, ctx: Context) -> None:
15+
print(ctx.rics.name)
16+
return await ctx.send(f"{ctx.user.name}, why the fuck would you join this place?")
17+
1418
NextgenerationBot().run(
1519
username = "Next-gen Bot",
1620
hex = "ff0000",

nightwatch/bot/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ def __init__(
3838
users = state.user_list,
3939
chat_logs = state.chat_logs
4040
)
41+
"""The RICS (Realtime Info and Communication System) server we are connected to."""
4142

4243
if message is not None:
4344
self.message = message
45+
"""The message we just received. This will be None if this is accessed from anything other then :on_message:."""
4446

4547
if user is not None:
4648
self.user = user
49+
"""The user who left or joined the server, or the author of the message we just received."""
4750

4851
async def send(self, message: str) -> None:
4952
await self.state.socket.send(orjson.dumps({"type": "message", "data": {"message": message}}), text = True)

0 commit comments

Comments
 (0)