getting the invite function ported over
This commit is contained in:
parent
3196fbd4e2
commit
60b7fb2713
@ -2,14 +2,14 @@ FROM python:3.8 as builder
|
||||
RUN apt-get update && apt-get install -y gcc python-pip
|
||||
ADD app/requirements.txt /requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
ADD app /app
|
||||
RUN pip install pylint
|
||||
ADD app /app
|
||||
RUN printf "\n\nTesting your python code for errors\n\n" && \
|
||||
pylint -E /app/*.py
|
||||
|
||||
FROM python:alpine
|
||||
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
|
||||
RUN printf "\n#########################\n Run dragon bot by typing \n python dragon-bot.py\n#########################\n\n"
|
||||
|
||||
|
@ -17,36 +17,54 @@ async def on_ready():
|
||||
# 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')
|
||||
async def corona(ctx):
|
||||
|
||||
|
||||
import corona
|
||||
result = corona.parse_message(ctx.message.content)
|
||||
|
||||
|
||||
await ctx.send(embed=result)
|
||||
|
||||
@bot.command(name='stock')
|
||||
async def stock(ctx):
|
||||
|
||||
|
||||
import stock
|
||||
result = stock.parse_message(ctx.message.content)
|
||||
|
||||
|
||||
await ctx.send(embed=result)
|
||||
|
||||
@bot.command(name='flows')
|
||||
async def flows(ctx):
|
||||
|
||||
|
||||
import river_stats
|
||||
result = river_stats.get_stats()
|
||||
|
||||
|
||||
await ctx.send(result)
|
||||
|
||||
@bot.command(name='8ball')
|
||||
async def eight_ball(ctx):
|
||||
|
||||
|
||||
import eight_ball
|
||||
result = eight_ball.check_8ball(ctx.message.content)
|
||||
|
||||
|
||||
await ctx.send(result)
|
||||
|
||||
@bot.command(name='purge')
|
||||
|
Loading…
x
Reference in New Issue
Block a user