parent
8f936a1f48
commit
6d74f4c24b
@ -1,11 +1,16 @@
|
||||
FROM python:3.8 as builder
|
||||
RUN apt-get update && apt-get install -y gcc python-pip
|
||||
FROM python as builder
|
||||
RUN apt-get update && apt-get install -y gcc make automake
|
||||
# RUN apk update && apk add --no-cache make python3-dev automake gcc libxml2-dev libxslt-dev g++
|
||||
ADD app/requirements.txt /requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
RUN pip install pylint
|
||||
ADD app /app
|
||||
RUN printf "\n\nTesting your python code for errors\n\n" && \
|
||||
pylint -E /app/*.py
|
||||
|
||||
# FROM python:rc-slim-buster
|
||||
# COPY --from=builder /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/
|
||||
# ADD app /app
|
||||
WORKDIR /app
|
||||
RUN printf "\n#########################\n Run dragon bot by typing \n python dragon-bot.py\n#########################\n\n"
|
||||
|
||||
|
@ -4,6 +4,14 @@ import requests
|
||||
import get_from_reddit
|
||||
|
||||
|
||||
def get_red_panda():
|
||||
red_panda = None
|
||||
while not red_panda:
|
||||
red_panda = requests.get('https://some-random-api.ml/img/red_panda').json()['link']
|
||||
# if 'mp4' in red_panda[-3:]:
|
||||
# red_panda = None
|
||||
return red_panda
|
||||
|
||||
def get_dog():
|
||||
return random.choice([random_sheeb, random_dog, random_dog_reddit])()
|
||||
|
||||
@ -33,15 +41,6 @@ def random_bird():
|
||||
bird = None
|
||||
return bird
|
||||
|
||||
def random_red_panda():
|
||||
red_panda = None
|
||||
while not red_panda:
|
||||
red_panda = requests.get('https://some-random-api.ml/img/red_panda').json()['link']
|
||||
if 'mp4' in red_panda[-3:]:
|
||||
red_panda = None
|
||||
return red_panda
|
||||
|
||||
|
||||
def random_dog_reddit():
|
||||
return get_from_reddit.get_image(
|
||||
[
|
||||
|
@ -35,6 +35,23 @@ async def invite(ctx):
|
||||
)
|
||||
await ctx.send(invite)
|
||||
|
||||
@bot.command(name='redpanda')
|
||||
async def redpanda(ctx):
|
||||
|
||||
import animals
|
||||
await ctx.send(animals.get_red_panda())
|
||||
|
||||
@bot.command(name='dog')
|
||||
async def dog(ctx):
|
||||
|
||||
import animals
|
||||
await ctx.send(animals.get_dog())
|
||||
|
||||
@bot.command(name='birb')
|
||||
async def birb(ctx):
|
||||
import animals
|
||||
await ctx.send(animals.get_birb())
|
||||
|
||||
@bot.command(name='corona')
|
||||
async def corona(ctx):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user