discord-cinema-bot/main.py

36 lines
1.0 KiB
Python

from discord.ext import commands
from discord import Permissions, PermissionOverwrite
# init bot
bot = commands.Bot(command_prefix="!")
# init registered cinemas
# subject to change -> save on disk
cinemas = dict()
@bot.group("cinema")
@commands.guild_only()
async def cinema(ctx):
pass
@cinema.command("create")
@commands.bot_has_permissions(manage_channels=True)
async def cinema_create(ctx, name, link=None):
# create permissions overwrites, so noone is allowed to join initially
overwrites = {
ctx.guild.default_role: PermissionOverwrite(connect=False)
}
# create voice channel and register
voice_channel = await ctx.guild.create_voice_channel(name, overwrites=overwrites, category=ctx.channel.category)
cinemas[ctx.message.id] = voice_channel
# create embed for series/movie
# not implemented yet.
# send announcement and create author reaction
announcement = await ctx.channel.send("React to this.")
await announcement.add_reaction("\U0001F3AB")
if __name__ == "__main__":
bot.run('')