Skip to content

Instantly share code, notes, and snippets.

@akku1139
Created January 10, 2025 03:45
Show Gist options
  • Save akku1139/74132442c496c8f04f0b655eead4b031 to your computer and use it in GitHub Desktop.
Save akku1139/74132442c496c8f04f0b655eead4b031 to your computer and use it in GitHub Desktop.
import discord
import os
TOKEN = "TOKEN" # Discordのtoken
ID = 1324402148137504800 # スパマーのID
client = discord.Client()
@client.event
async def on_ready():
print(f"{client.user} is online!")
group_dms = [dm for dm in client.private_channels if isinstance(dm, discord.GroupChannel)]
left_count = 0
for dm in group_dms:
if ID == dm.owner_id:
print(dm)
await dm.leave()
left_count += 1
print(f"{left_count}件のグループDMからの退出が完了しました")
client.run(TOKEN)
@akku1139
Copy link
Author

Discord.py-selfをインストールしてください

@akku1139
Copy link
Author

akku1139 commented Feb 6, 2025

1324402148137504800: aarrの荒らし
1320659175101038644: niha君

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment