Skip to content

Instantly share code, notes, and snippets.

@Zomatree
Last active July 7, 2023 12:45
Show Gist options
  • Save Zomatree/375316777961d0db2f0f9ed3f06a35a0 to your computer and use it in GitHub Desktop.
Save Zomatree/375316777961d0db2f0f9ed3f06a35a0 to your computer and use it in GitHub Desktop.
(lambda YTDLSource, coroutine, config, discord, random, math, re, logging, _import, sqlite3, asyncio, token, commands, regex, bot: [logging.basicConfig(level=logging.INFO),bot.load_extension("jishaku"),bot.event(coroutine(lambda: print("Ready!"))),bot.command(name="hello")(coroutine(lambda ctx: ctx.send("hello world"))),(lambda mention:(lambda temp_command: [setattr(temp_command, "__annotations__", {"user": discord.Member}),setattr(temp_command, "_doc__", "mentions someone"),setattr(mention, "callback", temp_command),mention.error(coroutine(lambda ctx, error: ctx.send("error" if not isinstance(error, commands.MissingRequiredArgument) else "no `user` arg, please pass one, thank u"))),])(lambda ctx, user: ctx.send(user.mention)))(bot.command(name="mention")(coroutine(lambda ctx, user: ()))),bot.command(name="8ball")(coroutine(lambda ctx, *, args: ctx.send(random.choice(["yes", "no", "idk", "shrug"])))),bot.command(name="quad")(coroutine(lambda ctx, *, args: ctx.send((lambda match: f"{-int(match[2])+math.sqrt((int(match[2])**2)-4*int(match[1])*int(match[3]))/2*int(match[1])}, {-int(match[2])-math.sqrt((int(match[2])**2)-4*int(match[1])*int(match[3]))/2*int(match[1])}")(re.match(regex, args))))),(lambda purge: (lambda temp_purge: [setattr(temp_purge, "__annotations__", {"amount": int}),setattr(purge, "callback", coroutine(temp_purge)),purge.error(coroutine(lambda ctx, error: ctx.send(f"```\n{error}\n```"))),])(lambda ctx, amount: [bot.loop.create_task(ctx.channel.purge(limit=amount + 1)), ctx.send(f"purged {amount}", delete_after=10)][1]))(bot.command(name="purge")(coroutine(lambda ctx, amount: ()))),(lambda join:(lambda temp_join: [setattr(temp_join, "__annotations__", {"channel": discord.VoiceChannel}),setattr(join, "callback", coroutine(temp_join)),])(lambda ctx, *, channel=None: (lambda channel: ctx.voice_client.move_to(channel) if ctx.voice_client is not None else channel.connect())(channel or ctx.author.voice.channel)))(bot.command(name="join")(coroutine(lambda ctx, *, channel: 0))),(lambda play:play.before_invoke(coroutine(lambda ctx: (ctx.author.voice.channel.connect() if ctx.author.voice else ctx.send("You are not connected to a voice channel.")) if ctx.voice_client is None else ctx.voice_client.stop() if ctx.voice_client.is_playing() else None)))(bot.command(name="play")(coroutine(lambda ctx, *, url: (lambda player: [ctx.voice_client.play(player, after=lambda e:print('Player error: %s' % e) if e else None), ctx.send('Now playing: {}'.format(player.title))])(YTDLSource.from_url(url, loop=bot.loop, stream=True))[-1]))),bot.command(name="volume")(coroutine(lambda ctx, volume: [ctx.send("Not connected to a voice channel."), setattr(ctx.voice_client.source, "volume", int(volume) / 100), ctx.send("Changed volume to {}%".format(volume))][0 if ctx.voice_client is None else - 1])),bot.command(name="stop")(coroutine(lambda ctx: ctx.voice_client.disconnect())),(lambda todo: [todo.command(name="add")(coroutine(lambda ctx, *, message: (lambda cur: [cur.execute("""INSERT INTO "todo" VALUES (?, ?)""", (ctx.author.id, message)), bot.db.commit(), ctx.send(f"Added {message} to your todo list.")])(bot.db.cursor())[-1])),todo.command(name="list")(coroutine(lambda ctx: (lambda embed: [embed.set_author(name=str(ctx.author), icon_url=str(ctx.author.avatar_url_as(format="jpg", static_format="jpg"))), ctx.send(embed=embed)])(discord.Embed(description="\n".join([f"{i}. {x[0]}" for i, x in enumerate(bot.db.cursor().execute("""SELECT Message FROM todo WHERE MemberID=?""", (ctx.author.id,)), 1)])))[-1])),])(bot.group(name="todo", invoke_without_command=True)(coroutine(lambda ctx: ctx.send_help(ctx.command)))),bot.run(token)])(type("YTDLSource", (__import__("discord").PCMVolumeTransformer,), {"__init__": lambda self, source, *, data, volume=0.5: [super(type(self), self).__init__(source, volume), setattr(self, "data", data), setattr(self, "title", data.get('title')), None][-1], "from_url": classmethod(lambda cls, url, *, loop=None, stream=None: (lambda data: cls(discord.FFmpegPCMAudio(data['url'] if stream else bot.ytdl.prepare_filename(data), options="-vn"), data=data))((lambda data: data['entries'][0] if "entries" in data else data)(bot.ytdl.extract_info(url, download=not stream))))}),*(lambda inspect, functools, collections, types, operator, sys, os, sqlite3, asyncio, config, commands: (lambda bot: [lambda func: (lambda coro: (lambda wrapper: [setattr(wrapper, "_is_coroutine", asyncio.coroutines._is_coroutine), wrapper][-1])(coro if not (sys.flags.dev_mode or (not sys.flags.ignore_environment and bool(os.environ.get('PYTHONASYNCIODEBUG')))) else functools.wraps(func)(lambda *args, **kwargs: (lambda w: [(operator.delitem(w._source_traceback, -1) if w._source_traceback else None), setattr(w, "__name__", getattr(func, '__name__', None)), w][-1])(asyncio.coroutines.CoroWrapper(coro(*args, **kwargs), func=func)))))(types.coroutine(func if inspect.isgeneratorfunction(func) else functools.wraps(func)(lambda *args, **kwargs: (lambda res: (yield from res) if asyncio.base_futures.isfuture(res) or inspect.isgenerator(res) or isinstance(res, asyncio.coroutines.CoroWrapper) else ((yield from res.__await__()) if hasattr(res, "__await__") and isinstance(res, collections.abc.Awaitable) else res))(func(*args, **kwargs))))), config, __import__("discord"), __import__("random"), __import__("math"), __import__("re"), __import__("logging"), lambda module: globals().__setitem__(module, __import__(module)), sqlite3, asyncio, config.token, commands, r"(-?\d+)x\^2([+-]\d+)x([+-]\d+)", bot])(type("Bot", (commands.Bot,), {"__init__": lambda self, *args, **kwargs: [setattr(self, "owner_id", 285130711348805632), super(commands.Bot, self).__init__(*args, **kwargs)][-1],"get_context": lambda self, message, cls=None: super(commands.Bot, self).get_context(message, cls=type("LShiftContext", (__import__("discord.ext", globals(), locals(), ["commands"]).commands.Context,), {"__lshift__": lambda self, other: [(self.send(other), self.bot.loop), None][1]})),"db": sqlite3.connect('todo.db'),"ytdl": __import__("youtube_dl").YoutubeDL({'format': 'bestaudio/best', 'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s', 'restrictfilenames': True, 'noplaylist': True, 'nocheckcertificate': True, 'ignoreerrors': False, 'logtostderr': False, 'quiet': True, 'no_warnings': True, 'default_search': 'auto', 'source_address': '0.0.0.0'})})(config.prefix, help_command = type("HelpCommand", (commands.MinimalHelpCommand,), {"get_command_signature": lambda self, command: f'{self.clean_prefix}{command.qualified_name} {command.signature}'})())))(__import__("inspect"), __import__("functools"), __import__("collections"), __import__("types"), __import__("operator"), __import__("sys"), __import__("os"), __import__("sqlite3"), __import__("asyncio"), __import__("config"), __import__("discord.ext", globals(), locals(), ["commands"]).commands))
@spinfish
Copy link

this is incredible

@spinfish
Copy link

actually when i try to run the code it keeps saying no module named discord...

@twitch0001
Copy link

image

@XuaTheGrate
Copy link

nut

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