#Get channel by name

1 messages · Page 1 of 1 (latest)

clear portal
#

I'm looking to achieve discord.utils.get(guild.text_channels, name="channel_name")
I'm doing this from inside a lightbulb plugin if that helps

#

from within a listener too btw

#

can i call ctx.cache?

crude osprey
#

very unrelated image but do something like bot.cache.get_channels_view()

#

it will give you a mapping of channel IDs to channel objects

#

just take the values, and do some filtering with them

clear portal
#

thankyou, ill try that now

crude osprey
#

im not a mod but idk if they will appreciate you posting random unrelated pictures in help forums

clear portal
#

i feel like im being a nuisance whenever i ask a question (because ive asked quite a few), so i add pictures to add a sense of irony (?) to them

crude osprey
#

that wont make you any less of a nuisance, if you were one

clear portal
#

itll probably make me more of one ngl

crude osprey
#

exactly

clear portal
#

yeaah, ill cut it out

crude osprey
#

you're always welcomed to ask questions. it's just the matter of whether the question was well formed or not (enough information was provided so people can help you adequately), and whether you actually tried to solve the problem yourself first (so we won't just spoonfeed you and so you wont learn anything)

sterile estuary
#

both have examples, you can choose whether find or get works best for you