Skip to content
This repository was archived by the owner on Nov 27, 2021. It is now read-only.

Tempy-Bot/discord.py-Console

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

discord.py-Console

This is a small Command line tool to execute commands from your console while your bot is running.

The implementation ist really similar to register commands in discord.py. Just implement the Console like this:

import discord
from dpyConsole import Console

client = discord.Client(intents=discord.Intents.all())
my_console = Console(client)

@client.event
async def on_ready():
    print("Im Ready")


@my_console.command()
async def hey(user: discord.User):  # Library automatically converts type annotations, just like in discord.py
    """
    Library can handle both synchronous or asynchronous functions
    """
    print(f"Sending message to {user.name} id: = {user.id}")
    await user.send(f"Hello from Console Im {client.user.name}")


my_console.start() # Starts console listener (opens new Thread to be nonblocking)
client.run("Token")

To invoke this command the line would be hey exampleUser#0001 or hey <valid_user_id>.

You can also add Cogs, to see an example look into the Example folder.

About

A small Command line tool to execute commands from your console while your bot is running.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%