Esempio n. 1
0
async def update_channel_open(prefix: str, channel: discord.TextChannel):
    if channel.name.startswith(YES) or channel.name.startswith(NO):
        new_name = prefix + channel.name[1:]
    else:
        new_name = prefix + channel.name
    try:
        await asyncio.wait_for(channel.edit(name=new_name), timeout=2)
    except asyncio.TimeoutError:
        return
Esempio n. 2
0
 async def swap(self, ctx, a: TextChannel, b: TextChannel):
     a_name, a_topic, a_position = a.name, a.topic, a.position
     b_name, b_topic, b_position = b.name, b.topic, b.position
     await asyncio.gather(
         a.edit(name=b_name, topic=b_topic, position=b_position),
         b.edit(name=a_name, topic=a_topic, position=a_position))