These are all methods directly derived from the library’s root.
Table of contents
It is recommended to check out the Bot and Bot classes, as they are referenced in this article
Methods
ChatSelfbot.create_session()
V1.0.0+
ChatSelfbot.create_session(username : str, password: str) -> Bot | None
This function will create a new Bot session, and return it. Returns None if there was an error creating the bot.
# Example code, confirms the username of the bot
import ChatSelfbot as selfbot
bot = selfbot.create_session("USERNAME", "PASSWORD")
if bot: # 'bot' might be None at error
@bot.event
async def on_ready():
print((await bot.user()).username)
bot.run()