Skip to content

Instantly share code, notes, and snippets.

View Luc1412's full-sized avatar
🎯
Focusing

Lucas Hardt Luc1412

🎯
Focusing
View GitHub Profile
@Luc1412
Luc1412 / roll.py
Created December 25, 2023 20:58
Christmas Giveaway Code
import random
import orjson
import io
# Get the Giveaway message and all users that reacted and are still on the server
msg = await bot.get_channel(1183749648880504962).fetch_message(1183849922441773077)
reaction = discord.utils.get(msg.reactions, emoji='🎁')
user_ids = [u.id async for u in reaction.users(limit=None) if guild.get_member(u.id)]
# Check for users that are eligable
@Luc1412
Luc1412 / patreon_discord.py
Last active November 2, 2023 08:51
Get Patreon data based on discord user id
# Campaign ID can be fetched trough the API (List all Campaigns: GET https://www.patreon.com/api/oauth2/v2/campaigns)
# access_token can be created on https://www.patreon.com/portal/registration/register-clients
# For more data, add fields to either fields[member] or fields[user]. All fields are listed on https://docs.patreon.com/#apiv2-resources
async def fetch_patreons(self, campaign_id, access_token):
patreons = {}
url = f'https://www.patreon.com/api/oauth2/v2/campaigns/{campaign_id}/members'
params = {
'include': 'user',
'fields[member]':
@Luc1412
Luc1412 / auth_flow.py
Last active March 15, 2024 11:16
This is the auth flow for valorant (async) + Some further research I did in the past
import re
import aiohttp
async def run(username, password):
session = aiohttp.ClientSession()
data = {
'client_id': 'play-valorant-web-prod',
'nonce': '1',
'redirect_uri': 'https://beta.playvalorant.com/opt_in',
'response_type': 'token id_token',