Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ch #example import
- prefix = "/" # this is where you choose the prefix, put this below imports
- def onMessage(self, room, user, message):#keep everything here the same, this goes where your old onMessage goes.
- # make global
- global activated
- global lockdown
- ## print to console
- #split message into command and args
- data = message.body.split(" ", 1)
- if len(data) > 1:
- cmd, args = data[0], data[1] # if command and args
- else:
- cmd, args = data[0], ""# if command and no args
- # put this above the command list
- if len(cmd) > 0:
- if cmd[0] == prefix:
- used_prefix = True
- cmd = cmd[1:]
- else: used_prefix = False
- else: return
- # I am putting this here to show you what a basic command is like using this prefix system
- elif used_prefix and cmd == "newprefix":
- room.message("worked")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement