File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ async def on_connect(self, ctx: Context) -> None:
11
11
async def on_message (self , ctx : Context ) -> None :
12
12
print (f"{ ctx .user .name } sent '{ ctx .message .message } '" )
13
13
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
+
14
18
NextgenerationBot ().run (
15
19
username = "Next-gen Bot" ,
16
20
hex = "ff0000" ,
Original file line number Diff line number Diff line change @@ -38,12 +38,15 @@ def __init__(
38
38
users = state .user_list ,
39
39
chat_logs = state .chat_logs
40
40
)
41
+ """The RICS (Realtime Info and Communication System) server we are connected to."""
41
42
42
43
if message is not None :
43
44
self .message = message
45
+ """The message we just received. This will be None if this is accessed from anything other then :on_message:."""
44
46
45
47
if user is not None :
46
48
self .user = user
49
+ """The user who left or joined the server, or the author of the message we just received."""
47
50
48
51
async def send (self , message : str ) -> None :
49
52
await self .state .socket .send (orjson .dumps ({"type" : "message" , "data" : {"message" : message }}), text = True )
You can’t perform that action at this time.
0 commit comments