Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
remove some old commands
Browse files
app.py
CHANGED
@@ -84,15 +84,6 @@ class DMButton(Button):
|
|
84 |
await interaction.response.send_message(message, ephemeral=True)
|
85 |
|
86 |
|
87 |
-
@bot.command(name='sendbutton')
|
88 |
-
async def send_button(ctx):
|
89 |
-
if ctx.author.id == 811235357663297546:
|
90 |
-
button = DMButton(label="Verify Discord Account", style=discord.ButtonStyle.primary)
|
91 |
-
view = View(timeout=None)
|
92 |
-
view.add_item(button)
|
93 |
-
await ctx.send("Click the button below to generate your verification link:",view=view) #
|
94 |
-
|
95 |
-
|
96 |
def generate_unique_string(length=6):
|
97 |
return secrets.token_hex(length // 2)
|
98 |
|
@@ -654,34 +645,7 @@ async def xp_help(ctx):
|
|
654 |
await ctx.author.send(help_message)
|
655 |
except Exception as e:
|
656 |
print(f"xp_help Error: {e}")
|
657 |
-
|
658 |
-
|
659 |
-
@bot.command()
|
660 |
-
async def count_users_with_role(ctx, role_id):
|
661 |
-
role = discord.utils.get(ctx.guild.roles, id=int(role_id))
|
662 |
-
count = sum(1 for member in ctx.guild.members if role in member.roles)
|
663 |
-
await ctx.send(f"Number of users with the role '{role.name}': {count}")
|
664 |
-
|
665 |
-
|
666 |
-
@bot.command()
|
667 |
-
async def send_hub_org_dm_retroactive(ctx, role_id):
|
668 |
-
if ctx.author.id == 811235357663297546:
|
669 |
-
lunar = bot.get_user(811235357663297546)
|
670 |
-
role = discord.utils.get(ctx.guild.roles, id=int(role_id))
|
671 |
-
# for every person with this role
|
672 |
-
# dm them message with link
|
673 |
-
if role:
|
674 |
-
for member in role.members:
|
675 |
-
try:
|
676 |
-
dm_message = f"Hey {member}! You've just been invited to join the Hugging Face Discord Community org! 🤗\n If you're interested in collaborating on open source projects, hanging out with the community or just enjoying your new badge, we're happy to have you! ❤️ https://huggingface.co/organizations/discord-community/share/wPKRAHYbAlaEaCxUxcqVyaaaeZcYagDvqc"
|
677 |
-
await member.send(dm_message)
|
678 |
-
await lunar.send(dm_message)
|
679 |
-
await asyncio.sleep(5)
|
680 |
-
except discord.Forbidden:
|
681 |
-
print(f"Could not DM {member.name}")
|
682 |
-
await lunar.send(f"Could not DM {member.name} a Hugging Face Org invite link")
|
683 |
-
|
684 |
-
|
685 |
|
686 |
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
687 |
def run_bot():
|
|
|
84 |
await interaction.response.send_message(message, ephemeral=True)
|
85 |
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
def generate_unique_string(length=6):
|
88 |
return secrets.token_hex(length // 2)
|
89 |
|
|
|
645 |
await ctx.author.send(help_message)
|
646 |
except Exception as e:
|
647 |
print(f"xp_help Error: {e}")
|
648 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
649 |
|
650 |
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN", None)
|
651 |
def run_bot():
|