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:
|
before_script:
|
||||||
- apk add --no-cache python3
|
- apk add --no-cache python3
|
||||||
|
- pip install -U pip
|
||||||
- pip3 install -r app/requirements.txt
|
- pip3 install -r app/requirements.txt
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
@ -2,6 +2,7 @@ FROM python:3.6.2-alpine3.6
|
|||||||
ADD app/requirements.txt /requirements.txt
|
ADD app/requirements.txt /requirements.txt
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
apk add --no-cache docker && \
|
apk add --no-cache docker && \
|
||||||
|
pip install -U pip && \
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
ADD app /app
|
ADD app /app
|
||||||
CMD python /app/dragon-bot.py
|
CMD python /app/dragon-bot.py
|
||||||
|
@ -2,6 +2,7 @@ FROM python:3.6.2-alpine3.6
|
|||||||
ADD app/requirements.txt /requirements.txt
|
ADD app/requirements.txt /requirements.txt
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
apk add --no-cache vim docker && \
|
apk add --no-cache vim docker && \
|
||||||
|
pip install -U pip && \
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
|
||||||
ADD app /app
|
ADD app /app
|
||||||
|
@ -7,6 +7,7 @@ then imported into the main bot
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
|
from gtts import gTTS
|
||||||
|
|
||||||
import core_utils
|
import core_utils
|
||||||
import decide
|
import decide
|
||||||
@ -311,6 +312,21 @@ async def on_message(message):
|
|||||||
"```{}```".format(' '.join(list(map(lambda x: x.name, message.author.roles))))
|
"```{}```".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'):
|
if message.content.startswith('!wallpaper'):
|
||||||
await client.send_message(
|
await client.send_message(
|
||||||
message.channel,
|
message.channel,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
discord.py
|
discord.py
|
||||||
docker
|
docker
|
||||||
|
gTTS
|
||||||
pylint
|
pylint
|
||||||
pyowm
|
pyowm
|
||||||
requests
|
requests
|
||||||
|
Loading…
x
Reference in New Issue
Block a user