DEV Community

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

Posted on

1 1

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)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️