Adding text to speech module and updating pip in the container
This commit is contained in:
parent
cf94718f00
commit
8118999343
@ -4,6 +4,7 @@ services:
|
||||
|
||||
before_script:
|
||||
- apk add --no-cache python3
|
||||
- pip install -U pip
|
||||
- pip3 install -r app/requirements.txt
|
||||
|
||||
stages:
|
||||
|
@ -2,6 +2,7 @@ FROM python:3.6.2-alpine3.6
|
||||
ADD app/requirements.txt /requirements.txt
|
||||
RUN apk update && \
|
||||
apk add --no-cache docker && \
|
||||
pip install -U pip && \
|
||||
pip install -r requirements.txt
|
||||
ADD app /app
|
||||
CMD python /app/dragon-bot.py
|
||||
|
@ -2,6 +2,7 @@ FROM python:3.6.2-alpine3.6
|
||||
ADD app/requirements.txt /requirements.txt
|
||||
RUN apk update && \
|
||||
apk add --no-cache vim docker && \
|
||||
pip install -U pip && \
|
||||
pip install -r requirements.txt
|
||||
|
||||
ADD app /app
|
||||
|
@ -7,6 +7,7 @@ then imported into the main bot
|
||||
|
||||
import os
|
||||
import requests
|
||||
from gtts import gTTS
|
||||
|
||||
import core_utils
|
||||
import decide
|
||||
@ -311,6 +312,21 @@ async def on_message(message):
|
||||
"```{}```".format(' '.join(list(map(lambda x: x.name, message.author.roles))))
|
||||
)
|
||||
|
||||
if message.content.startswith('!tts'):
|
||||
myobj = gTTS(
|
||||
text=' '.join(message.content.split()[1:]),
|
||||
lang='en',
|
||||
slow=False
|
||||
)
|
||||
file_path = '/tmp/memes.mp3'
|
||||
myobj.save(file_path)
|
||||
|
||||
await client.send_file(
|
||||
message.channel,
|
||||
file_path,
|
||||
)
|
||||
os.remove(file_path)
|
||||
|
||||
if message.content.startswith('!wallpaper'):
|
||||
await client.send_message(
|
||||
message.channel,
|
||||
|
@ -1,6 +1,7 @@
|
||||
beautifulsoup4
|
||||
discord.py
|
||||
docker
|
||||
gTTS
|
||||
pylint
|
||||
pyowm
|
||||
requests
|
||||
|
Loading…
x
Reference in New Issue
Block a user