0

^^

Yes, this question is very, very weird. I know that IDE is not recommended / prohibited to be used in this way too, but I'm asking because I'm deeply curious :3

Here is my code:

from discord.ext import commands

import asyncio
from async_timeout import timeout

bot = commands.Bot(command_prefix = "::", description = "Hey you")

@bot.event
async def on_ready():
    await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.playing, name="Hey!"))
    print("Have fun!")

async def salondethe():
    channel = bot.get_channel(123456789101112131)
    await guild.channel.send('test')    

bot.run("token")

And I would like to send salondethe() in the IDE to send a message in the channel 123456789101112131 Do you know a way? ^^ Thanks for the curious I am ^^

Brclsbtn
  • 11
  • 3
  • You want to start a bot in IDLE, and use IDLE's interactive prompt to issue commands to the bot? – user4815162342 Mar 17 '21 at 22:57
  • Just take `input` and send it to the necessary channel. use [this](https://stackoverflow.com/questions/58454190/python-async-waiting-for-stdin-input-while-doing-other-stuff) for input. – Ceres Mar 18 '21 at 16:19
  • @user4815162342 exactly – Brclsbtn Mar 18 '21 at 21:24
  • @Ceres oh thanks! i'll take a look! – Brclsbtn Mar 18 '21 at 21:25
  • 1
    You question and code have nothing to do with IDLE. You should edit to remove all references to it. IDLE is a python IDE application that provides a python-specific editor and an integreted gui shell. IDLE runs user code in a separate process, so most python code, including yours, should run the same as if run directly with the same python.exe from a command line. (The main exceptions involve user interface io, as discussed in the IDLE doc.) – Terry Jan Reedy Mar 18 '21 at 23:04

0 Answers0