In the end what you want is a database to store those channel_id values. One way of doing so would be a JSON as another answer suggested, but if you want to add your bot and use this functionality in many servers, the best would be to use a real database like SQL.
Taking into account that discord.py uses async interface, the best library for starting would be aiosqlite (Visit https://github.com/omnilib/aiosqlite).
A simple Python code to store those channel_id in your database would be something like:
async def set_channel(self, ctx, channel:discord.TextChannel):
database = await aiosqlite.connect(database_path)
cursor = await database.cursor()
sql = ("UPDATE welcome SET welcome_channel_id = ? WHERE guild_id = ?")
val = (channel.id, ctx.guild.id)
await cursor.execute(sql, val)
await database.commit()
await cursor.close()
await database.close()
This sample of code already asumes you have your database set up with the tables created, but with a tiny bit of knowledge you should be able to modify this fine.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…