DEV Community

Cover image for Build Personalized Discord Bots with Python and WayScript
Jesse Orshan
Jesse Orshan

Posted on

Build Personalized Discord Bots with Python and WayScript

In this video we'll look at how we can build custom commands onto a WayScript discord bot using python programming, discord, and WayScript.com

Python Code:

import re

keywords = inputs['keywords']
result = inputs['result']
discord_message = inputs['Discord Message Text']

command = re.compile(r'\![a-z]*')
matches = command.findall(discord_message)
print(matches[0])
found_keyword = matches[0]
print(keywords)
position = keywords.index(found_keyword)
action = result[position]

outputs['action'] = action

Top comments (0)