From 39370c4686037972f01d97750be7f9edb3450c01 Mon Sep 17 00:00:00 2001 From: fuegovic <32828263+fuegovic@users.noreply.github.com> Date: Sat, 28 Oct 2023 23:02:59 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot/bot.py | 23 +++-------------------- server/github_oauth.py | 9 --------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/bot/bot.py b/bot/bot.py index 917b171..f8d2916 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -66,7 +66,7 @@ async def on_startup(): print(f'{client.user} connected to discord') print('----------------------------------------------------------------------------------------------------------------') - print(f'Bot invite link: https://discord.com/api/oauth2/authorize?client_id={CLIENT_ID}&permissions=8&scope=bot') + print(f'Bot invite link: https://discord.com/api/oauth2/authorize?client_id={CLIENT_ID}&permissions=268453888&scope=bot') print('----------------------------------------------------------------------------------------------------------------') @@ -154,11 +154,6 @@ async def github(ctx: SlashContext): label="Auth", custom_id="auth", ), - Button( - style=ButtonStyle.RED, - label="🤷‍♂️", - custom_id="2", - ), Button( style=ButtonStyle.URL, label="⚠️ new issue", @@ -168,11 +163,6 @@ async def github(ctx: SlashContext): style=ButtonStyle.URL, label="💬 new discussion", url=f"https://github.com/{OWNER}/{REPO}/discussions/new/choose", - ), - Button( - style=ButtonStyle.GREY, - label="other button", - custom_id="5", ) ) ] @@ -204,19 +194,12 @@ async def start_callback(ctx: ComponentContext): print(f"tst: {userid}") if user_entry: - # If entry found, send confirmation message and break loop - await ctx.send("Confirmation: Your account has been successfully linked!", ephemeral=True) - - # Check if 'starred_repo' is set to true + # Check if 'starred_repo' is set to true and assign role if user_entry['starred_repo']: - # Fetch the role role = os.getenv('ROLE_ID') - #role = os.getenv('ROLE_ID') - print (f'1role = {role}') - # Assign the role await ctx.author.add_role(role, reason='auth') await ctx.send("role activated") - print (f'2role = {role}') + await ctx.send("Confirmation: Your account has been successfully linked!", ephemeral=True) break # If entry not found, wait for a short period before checking again diff --git a/server/github_oauth.py b/server/github_oauth.py index 51b013d..2a5c502 100644 --- a/server/github_oauth.py +++ b/server/github_oauth.py @@ -45,9 +45,6 @@ @app.route('/login') def login(): - """ - Initiates the GitHub OAuth login process. - """ discord_username = request.args.get('name') discord_id = request.args.get('id') session['name'] = discord_username @@ -57,9 +54,6 @@ def login(): @app.route('/authorize') def authorize(): - """ - Handles the GitHub OAuth authorization and user data retrieval. - """ discord_username = session.get('name') discord_id = session.get('id') message = "" @@ -133,9 +127,6 @@ def authorize(): @app.route('/') def home(): - """ - Renders the home page. - """ return render_template('home.html') if __name__ == '__main__':