Skip to content

A very basic python library for creating DisposableChat.com bots.

License

Notifications You must be signed in to change notification settings

murphy28/DisPyChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DisPyChat

A very basic python library for creating DisposableChat.com bots.

Basic Usage

from dispo import DisPyChat

room = {
    "name":"Room",
    "password":""
}

# Additional parameters include the Bot Name, Bot Prefix, and User Agent. Values default to the ones seen in the next line.
# Ex: DisPyChat(room,"DispoBot","!","Disposable Chat Bot")
bot = DisPyChat(room)

bot.message("Hello World!")

Handling Messages

# Logs every new message to the console with the message author.
@bot.onMessage
def onMessage(message,author,id):
  print(f"{author}: {message}")

Change Username

# Changes the bots username to the first word of the latest message.
@bot.onMessage
def onMessage(message,author,id):
  bot.newName(message.split()[0])

Get Users

# Returns an array of users in the chat.
print(bot.getUsers())

About

A very basic python library for creating DisposableChat.com bots.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages