Add docker
This commit is contained in:
14
main.py
14
main.py
@@ -9,8 +9,7 @@ try:
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
intents = discord.Intents.default()
|
||||
intents.message_content = True
|
||||
intents = discord.Intents.all()
|
||||
bot = commands.Bot(
|
||||
command_prefix=settings['prefix'],
|
||||
description='Moai',
|
||||
@@ -34,15 +33,14 @@ async def stone(ctx):
|
||||
await ctx.send('🗿')
|
||||
|
||||
|
||||
@bot.command()
|
||||
async def moai(ctx):
|
||||
async def play(ctx, src: str):
|
||||
# delete message
|
||||
await ctx.message.delete()
|
||||
|
||||
vc = ctx.author.voice.channel
|
||||
if vc:
|
||||
connection = await vc.connect()
|
||||
connection.play(discord.FFmpegPCMAudio(source="moai.mp3"))
|
||||
connection.play(discord.FFmpegPCMAudio(source=src))
|
||||
|
||||
# instantly disconnect, after audio is done playing
|
||||
while connection.is_playing():
|
||||
@@ -51,4 +49,10 @@ async def moai(ctx):
|
||||
else:
|
||||
print("User is not in a channel!")
|
||||
|
||||
|
||||
@bot.command()
|
||||
async def moai(ctx):
|
||||
await play(ctx, "audio/moai.mp3")
|
||||
|
||||
|
||||
bot.run(settings['token'])
|
||||
|
||||
Reference in New Issue
Block a user