getting the invite function ported over
This commit is contained in:
parent
caec6bd228
commit
c9cf63a92b
@ -2,14 +2,14 @@ FROM python:3.8 as builder
|
|||||||
RUN apt-get update && apt-get install -y gcc python-pip
|
RUN apt-get update && apt-get install -y gcc python-pip
|
||||||
ADD app/requirements.txt /requirements.txt
|
ADD app/requirements.txt /requirements.txt
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
ADD app /app
|
|
||||||
RUN pip install pylint
|
RUN pip install pylint
|
||||||
|
ADD app /app
|
||||||
RUN printf "\n\nTesting your python code for errors\n\n" && \
|
RUN printf "\n\nTesting your python code for errors\n\n" && \
|
||||||
pylint -E /app/*.py
|
pylint -E /app/*.py
|
||||||
|
|
||||||
FROM python:alpine
|
FROM python:alpine
|
||||||
COPY --from=builder /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/
|
COPY --from=builder /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/
|
||||||
COPY --from=builder /app /app
|
ADD app /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN printf "\n#########################\n Run dragon bot by typing \n python dragon-bot.py\n#########################\n\n"
|
RUN printf "\n#########################\n Run dragon bot by typing \n python dragon-bot.py\n#########################\n\n"
|
||||||
|
|
||||||
|
@ -17,6 +17,24 @@ async def on_ready():
|
|||||||
# f'Hi {member.name}, welcome to my ths server!'
|
# f'Hi {member.name}, welcome to my ths server!'
|
||||||
# )
|
# )
|
||||||
|
|
||||||
|
|
||||||
|
@bot.command(name='invite')
|
||||||
|
async def invite(ctx):
|
||||||
|
# Default to creating the invite to the #general channel
|
||||||
|
# if the user is in a voice channel, try to create the invite there
|
||||||
|
invite_channel = ctx.message.channel
|
||||||
|
try:
|
||||||
|
if ctx.message.author.voice.channel:
|
||||||
|
invite_channel = ctx.message.author.voice.channel
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
invite = await invite_channel.create_invite(
|
||||||
|
destination=invite_channel,
|
||||||
|
max_uses=1,
|
||||||
|
max_age=3600
|
||||||
|
)
|
||||||
|
await ctx.send(invite)
|
||||||
|
|
||||||
@bot.command(name='corona')
|
@bot.command(name='corona')
|
||||||
async def corona(ctx):
|
async def corona(ctx):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user