Skip to content

Instantly share code, notes, and snippets.

View LostLuma's full-sized avatar
💜
beep boop!

Lilly Rose Berner LostLuma

💜
beep boop!
View GitHub Profile
@LostLuma
LostLuma / async_generators.py
Last active March 14, 2024 23:38
Combines multiple async generators into one continuos stream.
import asyncio
GENERATOR_CONCLUDED = object()
def wrap_silent_anext(generator):
async def silent_anext():
try:
return await generator.__anext__()
# -*- coding: utf-8 -*-
"""
Mousey: Discord Moderation Bot
Copyright (C) 2016 - 2021 Lilly Rose Berner
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
// Adds a `/pronouns` slash command to the server
// Configure the roles you would like to use here
// The record maps choice name -> Discord role ID
const PRONOUN_ROLES: Record<string, string> = {
'she/her': '823327679855591454',
'he/him': '823327736277106698',
'they/them': '823328487549042688'
};
/*
MIT License
Copyright (c) 2021 Lilly Rose Berner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
/*
MIT License
Copyright (c) 2020 - 2023 Lilly Rose Berner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
import urllib.parse
import requests
CLIENT_ID = '432a893c-df7f-48d5-8f57-88d8e72a737f'
CLIENT_SECRET = '...'
REDIRECT_URI = 'http://localhost:1234/verify/xbox'

Keybase proof

I hereby claim:

  • I am lostluma on github.
  • I am lostluma (https://keybase.io/lostluma) on keybase.
  • I have a public key ASDu1w6xg9r0p4KN6k4siQ1yah-GUDCdRQp4wXNDSIEoygo

To claim this, I am signing this object: