How to send message without using command using hikari lightbulb for discord bot?

Viewed 1159

I'm making a discord bot, but since discord.py is no longer supported I wanted to make it using hikari lightbulb. I want to send a message to the channel specified by its id, but I didn't found any resources about it. In discord.py it was not a problem, simply:

channel = client.get_channel(channel_id)
await channel.send(message)

How to do similar thing using hikari without using command? - the function that sends the message is not called using command.

1 Answers

In hikari you don't even need to waste a call into the cache to get the channel:

bot = hikari.GatewayBot("TOKEN HERE")
await bot.rest.create_message(channel_id, message)

documentation

Related