Skip to content

Releases: OmegaDevStudio/Selfcord-Old

Selfcord v0.2.4

22 Jul 16:49
Compare
Choose a tag to compare

Selfcord v0.2.4

  • Quick bug fix
  • Added fetch_user for getting from cache
  • I think I fixed some events i forgo

Selfcord v0.2.3

14 Jul 16:53
Compare
Choose a tag to compare

Selfcord v.0.2.3

  • I apologise update small but fixed command handling related issues
  • Added events
  • Added docs too
  • Check ig i fail.

0.2.2

30 Jun 22:48
Compare
Choose a tag to compare

Selfcord v0.2.2

  • Small ish update. Kinda fixed modals? Only accepts one component as of rn.
  • Updated identify spoofing, more similar to current discord clients.

0.2.1

22 Jun 22:38
Compare
Choose a tag to compare

Selfcord v0.2.1

This update pretty chonky.

Improvements to command handling

  • Tokens encapsulated by "quotation marks" are now considered 1 argument. Here's an example.
@bot.cmd(description="Example poll command", aliases=['vote'])
async def poll(ctx, question: str, *options):
    msg = f"```ini\n[ {question} ]\n"
    for option in options:
        msg += f"{option}\n"
    msg += "```"
    await ctx.send(msg)
  • And then to call this in discord it would be !poll "Who is obamas best friend" joe john paul smith goku me
  • Or !poll "Is Joe real" yes no "maybe so" "of course" "no he dies in 2042"

Addition of delayed delete after sending a message

  • You can now delete a message after an interval of sending it easily with the delete_after argument.
  • This is part of any form of message send, reply, or edit. Here's an example.
@bot.cmd()
async def ping(ctx):
    await ctx.reply("pong!", delete_after=10)
  • This command will send pong! and then delete the message after 10 seconds.
  • I probably should've added this near the start lol. Better late than never.

Ability to load extension from urls.

  • Extensions are essentially selfcords version of cogs, they're simpler and much more easier to work with.
  • Normally you can load an extension through a file or folder in your filesytem like this.
await bot.load_extension(name="folder.file")
  • But now, you can also load extensions via urls, this will essentially download the file and place it into your project.
await bot.load_extension(url="https://raw.githubusercontent.com/Shell1010/test-extension/main/test.py", dir="test") 
# Gathers file data from the url
# Creates a directory named test
# Creates the test.py file in the test folder
# Loads extension from test.test.py
  • This will work as long as the file data follows the extension format.
  • Check here for an example extension. This counts as raw data so you can load it using that method.
  • Or here for a selfbot which utilises extensions. You can load it as long as you have the raw file data.
  • Idk why I added this I thought it'd be cool, like you could distribute your code amongst communities more easily.
  • People can just mix and match extensions with how they want.
  • Allows for easy editing of code maybe?

Ability to check sessions via events or methods

  • You can now view how many sessions are running on your token
  • Log out of these sessions
  • View session data

Session Event

  • View sessions on your token live via the event.
@bot.on("session")
async def sessions_check(sessions : list[Event_Session]):
    for session in sessions:
        print(session.platform)
        print(session.os)
        print(session.id)
        print(session.type)
Attributes for Event_Session

id: session_id
status: online, offline, dnd
os: operating system
platform: web, desktop, mobile, etc,
version: 0
type: user, selfcord, presence
  • Disclaimer, this includes ALL sessions, which means simple things like your rich presence, game activities, or even your current selfcord selfbot session. I have tried to differentiate them with the type attribute but this isn't always correct.

Device Session

  • These sessions are specifically for devices, unlike the event this is not real time, you can only view sessions whenever the request is fired.
  • Unlike the event, there is more precise data, for example platform even providing you with what sort of browser is being used, or location giving a general location of where the session started from.
sessions: list[Sessions] = await bot.get_sessions()
for session in sessions:
    session.remove("password")
# remove all active sessions on the token
Attributes for Session

hash: session hash
last_used: time when last used
location: location of where session was established
os: operating system
platform: web, desktop, mobile, etc,

Methods for Session

await session.remove("password")
  • This is equivalent to the devices tab on the discord settings page.
  • You cannot always assume the data from event session is exactly the same as the data that is gathered from this method (high chance they the same tho).

Trigger buttons on messages

  • You can now trigger buttons on messages sent by bots and stuff
  • Basically means stuff like giveaway joiners are now possible (monarch hint hint hint)
  • Buttons are part of the Action row object, which are part of the message object.
@bot.on("message")
async def message_test(message):
    for component in message.components:
        for button in component.components:
            if button.type == 2:
                await button.trigger()
Attributes for Action_Row

components: List of component objects, can include buttons
type: int which is 1 for action row
Attributes for Button

type: int which is 2 for button
style: style of button, 5 is link which doesn't have a custom-id to trigger
url: url for link style buttons, does not exist for the other types
custom_id: custom id for button
label: label for button
emoji: emoji for button
disabled: bool, check if button is disabled
message: the message instance it is part of
  • Apologies for the loop spam but discord has a lot of subarrays for components.
  • Only works if the component type is 2. This means it's a button
  • I have other classes set up for the other components, hopefully by next release I'd have added methods to these so you can interact with them too.

Miscellaneous fixes & improvements

  • Logging/Debug is no longer mandatory (no more funni color spam), set debug=True in the Bot initialisation to see logging.
  • Fixed some errors with relating to asyncio not showing up (basically no longer suppression of error!)
  • General improvements to performance (ujson for deserialisation)
  • Addition of bot.get_message(id) which gets a message from the bots cache. If outside of cache you'd have to resort to history/search.
  • Requirements.txt synced to setup.py, for some reason wasn't before????

0.2.0

16 Jun 16:11
Compare
Choose a tag to compare

Selfcord v0.2.0

  • Possible fixes to reconnect??? (not 100% sure)
  • Ability to send files via messages
    await ctx.send("perhaps big brain????", ["./test.png", "./test2.png"], tts=True)
    await ctx.reply("testing replies", ["/home/amin/Pictures/sheepshead_fish.png"])
    await ctx.edit("Fail", ["/home/amin/Pictures/pp.png"])
  • stuf i forgot

0.1.10

06 Jun 23:44
Compare
Choose a tag to compare

Selfcord v0.1.10

  • Mentions fix. They now hold a list of user objects
  • HTTP and general API optimisation. Less frequent reconnects.
  • Gud code

0.1.9

01 Jun 19:04
Compare
Choose a tag to compare

Selfcord v0.1.9

  • Addition of slash commands searching/triggering
  • Addition of call update, call create, and call delete events
  • Better http improvements
@bot.on("call_create")
async def test_call(channel, user, region):
    print(channel, user, region)


@bot.on("call_delete")
async def test_call2(channel):
    print(channel)


@bot.on("call_update")
async def testcall3(channel, user, region):
    print(channel, user, region)

@bot.cmd(description="Rob a user with dank memer slash command!", aliases=["rob"])
async def steal(ctx):
    search = await bot.interaction_search("rob", ctx.channel.id) # Search for the slash command
    # Returns a list usually.
    cmd = search.commands[0] # In our selfcord server where I did the testing I didn't have any other bots
    # I just set it to the first item, since I'm sure we weren't gonna get any other options
    for option in cmd.options: # Iterate through the options in the command - kinda don't need to do this
        if option.name == "user": # If the option name is user
            opt1 = option # set this as our option

    await bot.trigger_slash(
        cmd, # The command we want to trigger
        ctx.channel.id, # The channel id
        "270904126974590976", # The bot id
        guild_id=ctx.guild.id, # The guild id
        value=["1056383259325513888"], # The user we want to rob from, in this case myself
        option=[opt1], # The option we set, the user option
    )
# Attributes associated with SlashCommand and Option classes

Option.name: str
Option.type: int
Option.description: str
Option.options: list[Option] | None
Option.required: bool


SlashCommand.name: str
SlashCommand.type: int
SlashCommand.version: str
SlashCommand.options: list[Option] | None
SlashCommand.guild_id: str
SlashCommand.target_id: str
  • This kind of sucks in terms of syntax I am not sure how to improve this but will do so in the future.

0.1.8

30 May 16:50
Compare
Choose a tag to compare

Selfcord v0.1.8

  • Almost got slash commands completed
  • Eq dunder method so you don't have to specify particular attributes
# Instead of
if user.id == other.id:
  pass
if user == other:
  pass
  • Icon url attribute for guilds.

0.1.7

15 May 14:33
Compare
Choose a tag to compare
v0.1.7

Voice optional feature, optional install of opuslib and pynacl

0.1.6

12 May 18:57
Compare
Choose a tag to compare
v0.1.6

Mergwdwdawjd:q:qe branch 'main' of https://github.com/Shell1010/Selfcord