Skip to content

Commit

Permalink
final docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
iiPythonx committed Nov 26, 2024
1 parent dda2679 commit 5bd7c53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nextgen_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ async def on_connect(self, ctx: Context) -> None:
async def on_message(self, ctx: Context) -> None:
print(f"{ctx.user.name} sent '{ctx.message.message}'")

async def on_join(self, ctx: Context) -> None:
print(ctx.rics.name)
return await ctx.send(f"{ctx.user.name}, why the fuck would you join this place?")

NextgenerationBot().run(
username = "Next-gen Bot",
hex = "ff0000",
Expand Down
3 changes: 3 additions & 0 deletions nightwatch/bot/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ def __init__(
users = state.user_list,
chat_logs = state.chat_logs
)
"""The RICS (Realtime Info and Communication System) server we are connected to."""

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

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

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

0 comments on commit 5bd7c53

Please sign in to comment.