-
Notifications
You must be signed in to change notification settings - Fork 0
/
responses.py
34 lines (26 loc) · 1.25 KB
/
responses.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import random
def get_response(message: str) -> str:
"""
Given a message, returns a response based on the content of the message.
Args:
message (str): The message to be processed.
Returns:
str: The response to the message.
"""
p_message = message.lower()
if p_message == 'hello':
return 'Howdy!'
if p_message == 'roll':
return str(random.randint(1, 6))
help_message = (
"> fixTwitter is a simple Discord bot that fixes twitter.com and x.com links to fixup.com. \
To use it, simply type `??` followed by your message. If your message contains a twitter.com \
or x.com link, it will be replaced with a fixup.com link. \
For example, `??https://twitter.com` will be replaced with `https://fixup.com`. \
The bot will remove the original post, but replace it with a message of it's own and credit to the OP's username.\
\n> fixTwitter will also respond to: \n> - `??hello`: A greeting \n> - `??ping`: Check fixTwitter's latency or response time to the server \
\n> - `??roll`: A random number between 1 and 6"
)
if p_message == 'help':
return help_message
return r'Sorry, I don\'t know what you said. ¯\_(ツ)_/¯ I\'m just a little bird bot, try `??help` to see what I can do!'