I’m learning how to build Discord bots with Python and ran into an issue. I want to create a new channel and store it in a variable so I can use it right away without having to search for it later.
Traceback (most recent call last):
[...]
File "discord/client.py", line xxx, in _resolve_destination
raise InvalidArgument(fmt.format(destination))
discord.errors.InvalidArgument: Destination must be Channel, PrivateChannel, User, or Object. Received generator
It seems like create_channel isn’t actually creating the channel object properly. Is there something wrong with how I’m doing this in Python? What’s the right way to create a channel and immediately store it in a variable for later use?
yeah, u need to await the channel creation. otherwise, it just returns a coroutine, not the channel obj. so when u try to send the msg, discord thinks it’s a generator. make sure to do newChannel = await guild.create_text_channel(...).
You’re getting this error because create_channel returns a coroutine object, not the actual channel. The bot’s trying to send a message to what it thinks is a generator instead of a channel.
You need to await the channel creation. Also, don’t use bot.create_channel() - use the guild’s method instead:
I hit this same issue when I started with discord.py. The async stuff is confusing at first, but you’ll get used to awaiting channel operations. Just make sure you’re running this inside an async function.
Btw, bot.create_channel() and bot.send_message() are deprecated. Use guild.create_text_channel() and the channel’s .send() method instead.
I’ve built a bunch of Discord bots that create channels for game sessions. Pro tip: add error handling around channel creation. You’ll hit rate limits or permission issues that’ll crash your bot otherwise. The await stuff clicks once you’ve done it a few times.
But once you start building real Discord automation, you’ll spend more time debugging Python async than actually solving problems.
I maintained several Discord bots for team management. Every new feature - role assignments, scheduled messages, API integrations - meant more Python code and more breakpoints.
Switched to Latenode, never looked back. Create Discord channels, send messages, manage roles, integrate with databases or APIs without async Python.
The visual workflow builder handles Discord API calls for you. No more coroutines, no more debugging permission errors at 2am when your bot crashes.
Just drag Discord nodes into your workflow and connect them. Way cleaner than managing bot code.
Also, use guild.create_text_channel() instead of bot.create_channel() - that method’s deprecated.
Discord bots get messy fast once you add more features. I’ve dealt with this on multiple bots that needed channel management, permissions, and message automation.
What changed everything for me was switching to Latenode for Discord automation. Instead of writing all that Python and handling async operations, you create channels and manage bot logic through visual workflows.
You can trigger channel creation from webhooks, schedule messages, and integrate with other services without dealing with coroutines and error handling. Plus you get built-in logging and monitoring.
Once you see how much cleaner Discord automation gets with proper workflow tools, you won’t want to go back to raw Python bots.