-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtexttoowo.py
32 lines (23 loc) · 951 Bytes
/
texttoowo.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
import nextcord
from nextcord.ext import commands
import random
import os
vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
def last_replace(s, old, new):
li = s.rsplit(old, 1)
return new.join(li)
def text_to_owo(text):
""" Converts your text to OwO """
smileys = [';;w;;', '^w^', '>w<', 'UwU', '(・`ω\´・)', '(´・ω・\`)']
text = text.replace('L', 'W').replace('l', 'w')
text = text.replace('R', 'W').replace('r', 'w')
text = last_replace(text, '!', '! {}'.format(random.choice(smileys)))
text = last_replace(text, '?', '? owo')
text = last_replace(text, '.', '. {}'.format(random.choice(smileys)))
for v in vowels:
if 'n{}'.format(v) in text:
text = text.replace('n{}'.format(v), 'ny{}'.format(v))
if 'N{}'.format(v) in text:
text = text.replace('N{}'.format(v), 'N{}{}'.format(
'Y' if v.isupper() else 'y', v))
return text