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,36 +17,54 @@ 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):
|
||||||
|
|
||||||
import corona
|
import corona
|
||||||
result = corona.parse_message(ctx.message.content)
|
result = corona.parse_message(ctx.message.content)
|
||||||
|
|
||||||
await ctx.send(embed=result)
|
await ctx.send(embed=result)
|
||||||
|
|
||||||
@bot.command(name='stock')
|
@bot.command(name='stock')
|
||||||
async def stock(ctx):
|
async def stock(ctx):
|
||||||
|
|
||||||
import stock
|
import stock
|
||||||
result = stock.parse_message(ctx.message.content)
|
result = stock.parse_message(ctx.message.content)
|
||||||
|
|
||||||
await ctx.send(embed=result)
|
await ctx.send(embed=result)
|
||||||
|
|
||||||
@bot.command(name='flows')
|
@bot.command(name='flows')
|
||||||
async def flows(ctx):
|
async def flows(ctx):
|
||||||
|
|
||||||
import river_stats
|
import river_stats
|
||||||
result = river_stats.get_stats()
|
result = river_stats.get_stats()
|
||||||
|
|
||||||
await ctx.send(result)
|
await ctx.send(result)
|
||||||
|
|
||||||
@bot.command(name='8ball')
|
@bot.command(name='8ball')
|
||||||
async def eight_ball(ctx):
|
async def eight_ball(ctx):
|
||||||
|
|
||||||
import eight_ball
|
import eight_ball
|
||||||
result = eight_ball.check_8ball(ctx.message.content)
|
result = eight_ball.check_8ball(ctx.message.content)
|
||||||
|
|
||||||
await ctx.send(result)
|
await ctx.send(result)
|
||||||
|
|
||||||
@bot.command(name='purge')
|
@bot.command(name='purge')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user