Misc.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Sparcli 作者: 4Kaylum 项目源码 文件源码
def echoserver(self, ctx, serverName:str, channelName:str, *, content:str):
        '''
        Echos some content back into another server
        '''

        # It'll only be the owner sending this so there doesn't need to be any error handling.
        server = [i for i in self.sparcli.servers if i.name.lower() == serverName.lower()][0]

        if channelName.isdigit():
            channel = Object(channelName)
        elif channelName.startswith('<#') and channelName.endswith('>'):
            channel = Object(channelName[2:-1])
        else:
            channel = [i for i in server.channels if i.name.lower() == channelName.lower()][0]
        await self.sparcli.send_message(channel, content)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号