Why does the sendmsg code not work properly?


I’ve been trying to get where my bot says something in a certain channel by copying the channel ID, and using .sendmsg (ID) (message) , but for some reason, all I get is the else code of “Please specify a channel in the server!”
Here’s the code I have for it:

         elif message.content.startswith('{}sendmsg'.format(self.__cfg.pfx)):
            await message.delete()
            parts = message.content.split(' ')
            channel = self.__cfg.get_server().get_channel(parts(1))
            if channel:
                msg = ''
                for k in range(2, len(parts)):
                    msg += parts(k) + ' '

                await channel.send(msg)
            else:
                await message.channel.send('Please specify a channel in this server')
            return