From c5868750b4216d04b6b2753d5c4fa0e4880af89c Mon Sep 17 00:00:00 2001 From: deflax Date: Wed, 5 Feb 2025 22:29:39 +0000 Subject: [PATCH] Gives permission to the worshipper role --- src/api/ffmpeg-ideas.md | 6 +++++- src/discordbot/discordbot.py | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/api/ffmpeg-ideas.md b/src/api/ffmpeg-ideas.md index 0f81caf..29ee33d 100644 --- a/src/api/ffmpeg-ideas.md +++ b/src/api/ffmpeg-ideas.md @@ -37,4 +37,8 @@ ffmpeg -i brooklynsfinest_clip_1080p.mp4 \ -hls_segment_type mpegts \ -hls_segment_filename stream_%v/data%02d.ts \ -master_pl_name master.m3u8 \ --var_stream_map "v:0,a:0 v:1,a:1 v:2,a:2" stream_%v.m3u8 \ No newline at end of file +-var_stream_map "v:0,a:0 v:1,a:1 v:2,a:2" stream_%v.m3u8 + +ffmpeg -i /dev/video0 -i /dev/video2 -stream_loop -1 -re -i audio.mp3 -filter_complex "[0][1]overlay=enable='lt(mod(t,60),30)'[v]" -map "[v]" -map 2:a -c:v libx264 -b:v 4000k -maxrate 4000k -bufsize 8000k -g 50 -c:a aac -f flv rtmp://youtube + +ffmpeg -i source.mp4 -s 640x360 -hls_list_size 30 -hls_flags delete_segments+append_list+omit_endlist -f hls out.m3u8 \ No newline at end of file diff --git a/src/discordbot/discordbot.py b/src/discordbot/discordbot.py index 1a651e1..966090f 100644 --- a/src/discordbot/discordbot.py +++ b/src/discordbot/discordbot.py @@ -24,6 +24,7 @@ intents.message_content = True # Discord client bot = Bot(command_prefix=".", intents=intents) +worshipper_role_name = "worshipper" # Scheduler scheduler = AsyncIOScheduler() @@ -44,7 +45,7 @@ async def on_ready(): scheduler.start() @bot.command(name='hello', help='Say hello to the bot') -@has_permissions(administrator=True) +@has_role(worshipper_role_name) async def hello(ctx): author_name = ctx.author.name await ctx.channel.send(f'hi, `{author_name}` :blush:') @@ -52,8 +53,8 @@ async def hello(ctx): @hello.error async def hello_error(ctx, error): if isinstance(error, CheckFailure): - msg = "{} access denied!".format(ctx.message.author.mention) - await ctx.send(msg) + author_name = ctx.author.name + await ctx.channel.send(f'do I know you, `{}`?') @bot.command(name='epg', help='Lists scheduled streams') async def epg(ctx):