Last active
March 24, 2024 06:43
-
-
Save Buggem/e077939b956a79cafc91871ab1e52948 to your computer and use it in GitHub Desktop.
send messages as bots!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
credits = ''' | |
ANONYMOUSDISCORDER.PY is apart of the \'undefined\' project, a project dedicated to | |
HIDING YOUR IDENTITY! | |
''' | |
token = '' # here goes the token | |
from subprocess import run | |
import asyncio | |
run('clear;clear', shell=True) | |
import discord | |
intention = discord.Intents.default() | |
intention.message_content = True | |
intention.members = True | |
client = discord.Client(intents=intention) | |
logged = False | |
# a generator that yields items instead of returning a list | |
def getUsers(cli): | |
for guild in cli.guilds: | |
print(guild) | |
for member in guild.members: | |
yield member | |
@client.event | |
async def on_ready(): | |
global channel, logged | |
if (not logged): | |
print('We have logged in as {0.user}'.format(client)) | |
if mode == 0: | |
print((list(map(lambda a: a.name, list(client.guilds))))) | |
channel = client.guilds[int(input("WHICH ONE? "))].system_channel | |
else: | |
known = list(getUsers(client)) | |
print((list(map(lambda a: a.display_name, known)))) | |
membi = known[int(input("WHICH ONE? "))] | |
channel = membi.dm_channel | |
if channel == None: | |
channel = await membi.create_dm() | |
logged = True | |
while True: | |
input(f"PRESS ENTER TO SEND MESSAGE TO {channel.guild.name if mode==0 else channel.recipient.name}") | |
async with channel.typing(): | |
# Typing right now... | |
await channel.send(input('WHAT DO YOU SEND? ')) # await your input | |
else: | |
print("Sorry about that crash.\nWe have logged in again as {0.user}.".format(client)) | |
@client.event | |
async def on_message(message): | |
if message.author == client.user or not (message.guild.system_channel.id == channel.id if mode==0 else message in [meage async for meage in channel.history(limit=10)]): | |
return # infinite callbacks --- no way | |
print(str(message.author.display_name) + ' sent: ' + str(message.content)) # Who sent what | |
#async with message.channel.typing(): | |
# # Typing right now... | |
# await message.channel.send(input('Your reply?')) # await your input | |
mode = int(input("DISCORD MODE\n0=normal\n1=dms\n")) | |
client.run(token) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment