Skip to content

Commit

Permalink
feat: 🌟
Browse files Browse the repository at this point in the history
  • Loading branch information
fuegovic committed Oct 29, 2023
1 parent 5236bfd commit 39370c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 29 deletions.
23 changes: 3 additions & 20 deletions bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('----------------------------------------------------------------------------------------------------------------')


Expand Down Expand Up @@ -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",
Expand All @@ -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",
)
)
]
Expand Down Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions server/github_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = ""
Expand Down Expand Up @@ -133,9 +127,6 @@ def authorize():

@app.route('/')
def home():
"""
Renders the home page.
"""
return render_template('home.html')

if __name__ == '__main__':
Expand Down

0 comments on commit 39370c4

Please sign in to comment.